I edited Alchbot a little, I wanted to add in support for adding numbers
package Chatbot
{
function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
echo("recived");
parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(%name !$= $Pref::Player::NetName)
return;
echo("name right");
if(%msg $= "Alchbot, Test Active")
{
commandToServer('messageSent',"[AlchBot]: Activity Test Succeed!");
}
else if(getWords(%msg, 0, 5) $= "Alchbot, generate a random number between" && getWord(%msg, 7) $= "and" && getWordCount(%msg) == 9)
{
echo("right");
%a = getWord(%msg,6);
%b = getWord(%msg,8);
%c = getRandom(%a,%b);
commandToServer('messageSent',"[Alchbot]: The number returned was " @ %c);
}
else if(getWords(%msg, 0, 1) $= "Alchbot, subtract" && getWord(%msg, 3) $= "from" && getWordCount(%msg) == 4)
{
echo("right");
%a = getWord(%msg,2);
%b = getWord(%msg,5);
%c = %a - %b;
commandToServer('messageSent',"[Alchbot]: The number returned was " @ %c);
}
else if(%msg $="Alchbot, Update")
{
exec("Add-Ons/Client_AlchBot/client.cs");
commandToServer('messageSent',"[Alchbot]: Systems updated.
}
}
}
};
activatePackage(Chatbot);
Unfortunately, as always, it didn't work. It reports an error report in the console but I don't know what it means.