Blockland Forums > Modification Help
Chatbot syntax errors.
slimabob:
Awesome, thanks
slimabob:
Now it's giving me a syntax error on line 6, which happens to be:
--- Code: ---switch$(%msg)
--- End code ---
Why is that?
(Dangit, another double post)
otto-san:
post the entire code here if there's an error
slimabob:
--- Code: ---package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
switch$(%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 "Mimic":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: What do you want?");
case "Derp":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Herp-a-Derp");
case "lol":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: HAHAHAHAHAHA.. I don't get it..");
case "moo":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Shut up, you aren't some kind of cow!");
case "gtfo":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: No, YOU get the fudge out! ..I'm kinda hungry now..");
case "cool":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: What are you talking about? I'm not cold!");
case "shut up":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: No you do the shutting of the up.");
case "no you shut up":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: No YOU do this shutting up thing!");
case "asdf":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Oh no, what went wrong NOW?");
case "GO JUMP IN A TOILET!":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: But it's cold and wet in there and I don't like it!");
case "oops":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Oh no, what did you do THIS time?");
case "slimabob":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Hey, I know that guy!");
case "Hia":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: I hope this server was better than the last one..");
case "Dont worry mimic, it will be":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: It had better be, or I'll ragequit.");
case "afk":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: He's going AFK, quick everyone do something annoying to him!");
case "brb":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Okay.. but don't take too long..");
case "connected.":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Hi, I don't think I like you.");
case "I don't like you":
commandtoserver('messagesent',"<color:e5e500>Mimic<color:ffffff>: Good, then the feeling's mutual.");
}
}
};
activatePackage(chatbot);
--- End code ---
Munkey:
--- Quote from: slimabob on July 30, 2011, 03:18:28 PM ----snip-
--- End quote ---
You can't have a semicolon after switch$(%msg).