Chatbot's can do some amazing thing's. but they are very limited.
(also the reason i'm making this is because I am tired of seeing Dexx's chatbot posts.)
1st, if a server has a mod that a client can access, or needed to be admin with, and also involves chatbots, they can use it.
But, like I said before, your limited.
2nd, don't forget around with chatbots alot because if its annoying enough then it will piss people off.
Anyways, basic code for chatbots and whatever.
function clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
parent::clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(getWord(%msg,0)$="!test")
{
commandtoserver('messagesent',"Test!");
}
}
That's your basic code.
All it does is reads the first line and makes sure its !test.
The bad thing about this: its vulnerable for any user to use. To make it for you to use and only you, do this:
function clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
parent::clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(%name $="NAMEHERE")
{
if(getWord(%msg,0)$="!test")
{
commandtoserver('messagesent',"Test.");
}
}
}
There's your basic stuff for chat bots. Now for a simple get random which uses something different from clientcmdchatmessage.
function nmh_type::send(%this)
{
%msg=%this.getvalue();
parent::send(%this);
if(getWord(%msg,0)$="!getrandom")
{
%min = getword(%msg,1);
%max = getword(%msg, 2);
%result = getrandom(%min, %max);
commandtoserver('messagesent',%result);
}
}
As for letting other people being able to use your chatbot, tell me if i'm wrong and correct me, but i'm pretty sure this is how you do it
for specific players to use your chatbot (by name)
function clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
parent::clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
if(%name $="Frostwind" || %name $="Whomever")
{
if(getWord(%msg,0)$="!test")
{
commandtoserver('messagesent',"It was a success!");
}
}
}
Correct me if i'm wrong.
Chat bot calculator stuff.
Ok, you need to use nmh_type::send for this but if your getting good with chatbots you should know.
Hint: It has to do with variables like %var1 = getWord(%msg,1);
%var2 = getWord(%msg,2);
%var3 = getWord(%msg,3);
while var2 is being the sign of: + - / *
I expect you to be able to script that. It's simple. Really.
(if you cant then go away.)
You're on your own.
IF YOU HAVE ANY SUGGESTION'S ON CHAT BOT'S, YOUR WELCOME TO POST AND I MIGHT PUT IT UP HERE IF USEFUL.