Blockland Forums > Modification Help
Chatbot syntax errors.
(1/6) > >>
slimabob:
I was following this tutorial and found it kind of confusing. Nonetheless, I tried my best to do what it said and got this


--- Code: ---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") {
commandToServer('messageSent',"This was a triumph!");
}
};
activatePackage(chatbot);
--- End code ---

I don't know a ton about scripting yet and I'm wondering what is causing the syntax errors.
Munkey:
You need a semicolon(;) after you parent.


--- Code: ---parent::clientCmdChatMessage(%a,%b,%c,%msg,%cp,%name,%cs,%msg);
--- End code ---
slimabob:
Thanks. Now it says line 7 contains syntax errors though.

Fixed. Now it is saying line 8 is incorrect and contains errors.
Wizzeh:
You've got the wrong number of brackets. The number of open and closed brackets in your script should be the same.
slimabob:

--- Quote from: Wizzeh on July 30, 2011, 12:02:16 AM ---You've got the wrong number of brackets. The number of open and closed brackets in your script should be the same.

--- End quote ---

But if i have 5 brackets total, what do i do? Just add another one? And if so, does it matter where?
Navigation
Message Index
Next page

Go to full version