Blockland Forums > Modification Help

Toggling client chatbot on/off?

Pages: << < (3/5) > >>

ThinkInvisible:

Add:
-a Default in the switch to see if it's not registering chat right
-Several echos saying "phase _ OK" in different areas of the script

Bloxxed:

You can't use loving colors.

jes00:

Try it now:

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

MegaScientifical:


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

You didn't have the comma in the first word check. Say "Mimic, " and one of those cases to get a response. And you do realize that the color doesn't show in those servers, right? the tags are useless if they are automatically removed before anyone can see them, waste of bytes, so don't use them.

Chrono:

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

Pages: << < (3/5) > >>

Go to full version