Author Topic: New system for my chat bot, but it has a weird syntax error!  (Read 762 times)

Client checking Add-On: Script_AdamBot
Loading Add-On: Script_AdamBot (CRC:421358409)
Add-Ons/Script_AdamBot/client.cs Line: 171 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^^^^ if(hasItemOnList($AFKBot::List, %name))
^^^^^{
^^^^^^$AFKBot::list = removeItemfromList($AFKbot::List, %name);
^^^^^^commandToServer('messageSent', "AdamBot: " @ %name @ " is back!");
^^^^^}
^return parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);
^}
};##
##ActivatePackage(AdamBot);

>>> Error report complete.

ADD-ON "Script_AdamBot" CONTAINS SYNTAX ERRORS

I already checked and nothing is wrong with the "{".

post the entire code

or possibly just what's immediately after it and everything before it

but preferably the former

oh my god
that's the same stuff that's in rtb
return parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);

do
this
parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);
stuff delivers syntax errors every loving time you try to do anything with TCP objects

There's no semicolon after 'return'

Oh nvm I see it's all one line (reading op from phone)
« Last Edit: March 29, 2012, 09:20:54 PM by Treynolds416 »

oh my god
that's the same stuff that's in rtb
return parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);

do
this
parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);
stuff delivers syntax errors every loving time you try to do anything with TCP objects
What's the use in returning the parent?

What's the use in returning the parent?

If the original function returns a value and you don't return what calling the parent returns, you'll break functions that use the return value of the original function.

Same error. I tried not returning it.

I fixed the error myself, it was a different function that is was confusing its {} with the others.
« Last Edit: March 30, 2012, 08:14:55 AM by adam savage »

it was a different function that is was confusing its {} with the others.
which is why you should have
posted the entire code

just a note for the future

oh my god
that's the same stuff that's in rtb
return parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);

do
this
parent::clientCmdChatMessage(%c,%a,%b,%fmsg,%cs,%name,%cp,%msg);
stuff delivers syntax errors every loving time you try to do anything with TCP objects
That's not the part causing the syntax error.

That's not the part causing the syntax error.
i was abnormally mad that day

i also read the posts above.

no one ever told me the parent might return stuff >:(

i was abnormally mad that day

i also read the posts above.

no one ever told me the parent might return stuff >:(
You should always assume that a parent will return stuff.