bordemstirs
Member
When setting the script via Preference->Automation, mafia saves the preference as chatBotScript instead of chatbotScript.
Is this an intentional change? The preference has been chatbotScript, not chatBotScript for as long as I've been using it.
There were three places in the code which used the setting:I'm open to suggestions, but looking at the code, I believe that calling the preference chatbotScript was a programmer error
user chatbotScript
user chatbotScriptExecuted false
Revision 12349 makes it chatbotScript everywhere - so existing Chatbots will continue to execute without changing the setting name - rather than chatbotScript in 2 places and chatBotScript in 1 place (pre-12338), or vice versa (12338).Chatbot (chatbotScript)
Will execute whenever a private message is received
Requires a special main declaration which can have an optional third parameter:
void main(string sender, string message)
void main(string sender, string message, string channel)
'sender' is the name of the player who sent the message
'message' is the message that was sent
'channel' is "/clan" for clan messages and the empty string for private messages