Author Topic: Chatbot Help?  (Read 791 times)

Hey, Ive played Blockland since.. A while. :p

I've never gotten into scripting, and I'd like to start.

I've seen a few scripts and I came across a Chat Bot. Im sure you know what it is.

So, can someone teach me or give an example of a chat bot?

I tried to make one, and I made this

Quote
package chatbot {
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg) {
parent: :clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg);
if (%msg $= "testing testing 123") {
   if (%name $= "Kendawg") {
      commandToServer('messageSent',"I hear you, shut the FAK UP!");
   }
}
};
activatePackage(chatbot);


Code: [Select]
package chatbot {
  function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
    {
    parent::clientCmdChatMessage(%a,%b,%c,%msg,%cp,%name,%cs,%msg);
    if (%msg $= "testing testing 123 123") {
      commandToServer('messageSent',"I hear you, shut the FAK UP!");
    }
  }
};
activatePackage(chatbot);

You want to make sure that you have a good coding style. It needs to be easily read by another person.

Code: [Select]
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%msg,%cp,%name,%cs,%msg);

if (%msg $= "testing testing 123 123")
{
commandToServer('messageSent',"I hear you, shut the FAK UP!");
}
}
};
activatePackage(chatbot);

Note how I used tabs for indentation instead of spaces and that each bracket { } has it's own line.

So, can someone teach me or give an example of a chat bot?
What kind of chat bot?