//General Prefs
$BotName = "GravBot"; //Name of a Bot
$BotTrigger = $BotName @ ","; //The word that triggers the bot, like "GravBot, how are you?" The bot would read how are you?
$BotResponse = $BotName @ ":"; //The first word of the bots replys.
//Messages
$BotGet[0] = "Test"; //What the person says
$BotMessage[0] = "Do you doubt my ability to work?"; //What the bots says back
$BotGet[1] = "Hey " @ $BotName @ "!"; //What the person says
$BotMessage[1] = "I dont want to hear you"; //What the bot says back
$BotGet[2] = "Who made you?"; //What the person says
$BotMessage[2] = "Brian Smith good sir."; //What the bot says back
$BotMessageCount = 2;
//Allowed Names
$AllowedName[0] = "xXGravity DogXx"; //Allowed name
$AllowedName[1] = "Brian Smith"; //Alowed name
$AllowedName[2] = "Next Friend Name"; //Alowed name
$AllowedNameCount = 2; //The amount of allowed names
//To add a message
//Type in: $BotGet[num] = "what the bot recieves to get the message";
//Then after that type in: $BotMessage[same num as above] = "what the bot says to the message, without the botname: part";
//Then to update your BotMessageCount to the number you put in. The number you put in should be the next number in order.
//To add an allowed name
//Almost the same as above, basicly type in after the last allowed name
//$AllowedName[next num] = "Friends name";
//Then you adjust the AllowedNameCount.
//To change the bot name
//You just change it in the text
//To change bot trigger
//Same as above, if you want to include the bots name
//Instead of just putting GravBot, type in " @ $BotName @ "
//And it will automaticly include the bot name
//To change the bot message
//Exact same thing as above, except just change the $BotResponse.
package Gravbot
{
function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
Parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(firstWord(%msg) $= $BotTrigger)
{
%cmd = restWords(%msg);
for(%i=0;%i<$AllowedNameCount;%i++)
{
if(%name $= $AllowedName[%i])
%y = 1;
}
if(%y)
{
for(%i=0;%i<$BotMessageCount;%i++)
{
if(%cmd $= $BotGet[%i])
%reply = $BotMessage[%i];
}
if(%reply !$= "")
commandToServer('messageSent',$BotResponse SPC %reply);
else
commandToServer('messageSent',$BotResponse @ " invalid command.");
}
}
}
};activatepackage(Gravbot);
Includes a tutorial on how to add things, so only your friends can play with it.
I haven't tested it, though you can just use it freely.
This basicly just gives you the option to do a stuff ton more things.
Like you can change what the bot says in his message, what triggers the bot
The name of the bot. You can add people who can use it to prevent people from using it
And you can also add temporary messages in console.
Tutorial is in the code. Uhm, I haven't tested it, so anyone can fix.