Author Topic: Toggling client chatbot on/off?  (Read 3366 times)

I'm so confused... It executes properly but doesn't respond to anything I say to him. Ive tried telling him to wake up but that has no effect.

Code: [Select]
package MimicBot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
Parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(firstWord(%msg) $= "Mimic" && (!$MimicBotOff || %msg $= "Mimic Wake up"))
{
switch$(restWords(%msg))
{
case "Testing":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: This was a triumph!");
case "Hi":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Hello how are you?");
case "Good":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: That's not good, that's Great!");
case "lol":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: HAHAHAHAHAHAAA I don't get it..");
case "derp":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Herp-a-Derp.");
case "wtf":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: What the fail?!? I don't understand your human language at all..");
case "Mimic":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: What do you want?");
case "Hi":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Hello.");
case "Cool":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: What are you talking about?! I'm not cold!");
case "I don't know":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Wait, you DON'T know?! Everyone knows!!");
case "What?":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: You heard him!");
case "NO U":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: No, i do believe he WAS talking to you.");
case "slimabob":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Hey, I know that guy!");
case "No wait":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: No you wait. This is MY game MY rules.");
case "Hi everyone.":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: I don't see anyone here i like..");
case "Shut up":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: No you shut the up.");
case "No YOU shut up":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: No you do this shutting up thing!");
case "afk":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Quick, he's going afk! Do all sorts of annoying stuff to him before he comes back!");
case "This sentence is false.":
commandToServer('messageSent',"<color:e5e500>Mimic<color:ffffff>: FFFFFFFUUUUUUUUUUU- PARADOOX!!!!!!!!");
case "Cake":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: LIES! THERE IS NO CAKE!");
case "That makes mimic sad.":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: WAAAAAAA I'M FEELING SIMULATED SADNESS!!!!");
case "who are you?":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: To tell you the truth, I have no idea.");
case "Youre stupid!":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: Technicaly, since I'm a computer program, I'm smarter than you..");
case "your mom":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: I don't have a mom, I'm an orphan.");
case "bye":
commandToServer('messageSent', "<color:e5e500>Mimic<color:ffffff>: BYE! DON'T COME BACK!");
case "Go to sleep":
$MimicBotOff = 1;
case "Wake up":
$MimicBotOff = 0;
}
}
}
};
activatePackage(MimicBot);

Crap triple post....
That's not even what I'd consider a "bot".
No, that's just reads one phrase and gives out another.
No capacity for learning at all.
e.g. spam

Or if it's in a package you could do deactivatepackage(chatbot);
And then he wouldn't be able to turn it back on

And then he wouldn't be able to turn it back on
Yes, it does.

Protip: You can use more than one line in a switch check.

What are you directing that at? I reduced the code by making responses variables instead of full commands. As for the turning on and off, I wasn't able to conceive just how to implement that. My code has activations in a different script not interacting with chat, so it wouldn't get included in an on off check. Can't really explain, but you can show what you think would work.

That's not even what I'd consider a "bot".
No, that's just reads one phrase and gives out another.
No capacity for learning at all.
e.g. spam

Sorry to tell you, but according to everyone I meet in BL, you're wrong. Any chat script is apparently a "bot" to them. I could quote case in point from my chatlogger, but I think you've witnessed this yourself.

That's not even what I'd consider a "bot".
No, that's just reads one phrase and gives out another.
No capacity for learning at all.
e.g. spam

Would you say that silly little piece of code Murela or whatever the chat bot's name was that you made was a self learning bot?
No. It just spams and has the intelligence of a golf ball.

And then he wouldn't be able to turn it back on

activatePackage(chatBot);
« Last Edit: August 23, 2011, 01:12:18 PM by infiniteLoop »

activatePackage(chatBot);
that's manual, he means that the "wake up" command wouldn't work.