- Edited
Hello world :) hm, so i would like to make a chatbot. There's a few months a made it in flash AS3, but with GDScript, i don't know how to do that. May be it's possible to "translate" AS3 to GDScript?...
Before i made this (in flash) :
For example, i had a label for the answer called "att", and an inputtext called "lutilisateur". When the word "tchao" is detected in a text (for example, "So, i must go to the supermarket ; tchao Mann xD"), it happens this, for 1 answer :
var aok01:String = lutilisateur.text;
if(aok01.indexOf("tchao") != -1){ att.text = "Aurevoir";}
when the word "bonjour" is detected, it happens this, for random awswers :
var listeFT:Array = ["Bonjour", "Salut", "Hello", "Coucou"];
var choixFT:String = listeFT[Math.floor(Math.random()*listeFT.length)];
if(aok01.indexOf("bonjour") != -1){ att.text = choixFT;}
(sorry for the indentation xD)
is it possible to do that with Godot?
Thanks for your advice :)
Alain