Creating A Chat Bot.
If you haven't already, you should first familiarize yourself with everything in the SCRIPTING tab above as we will use everything learned from there to create our first chat bot.
Firstly, let's get our main package going where we will be intercepting data sent by yourself and other players for our chatbot to parse through.
Firstly, let's get our main package going where we will be intercepting data sent by yourself and other players for our chatbot to parse through.
Next, let's define some variables and simple arrays that will be used to respond to certain phrases. We are going to define all of our variables above our package declaration.
Now that we have our variables defined, let's write some needed functions. Functions written were:
chatBot_getRandomPhraseFromWord(%word)
chatBot_messageHasTriggerWord(%string)
chatBot_say(%string)
chatBot_getRandomPhraseFromWord(%word)
chatBot_messageHasTriggerWord(%string)
chatBot_say(%string)
Final Step!
We are almost finished, now we just need to do some logic statements in the myFirstChatBot package and that should do it for our first chat bot.
That's all there is to it!
Good job and keep learning, you can use the last pastebin paste to zip it up and create an add-on. You can keep adding new phrases using the $chatBot::response[TRIGGER] variables.