Author Topic: Syntax error  (Read 7702 times)

It's what I saw in another topic regarding almost the same exact error, and what I said was basically a repeat of what they said, so I assumed it was correct. I thought that they knew what they were doing. Also, Zeblote agreed with what I said in another topic, so I assumed it was correct. I guess not.
Where is "another topic"?


Where is "another topic"?
I've been reading through the last couple of pages of Coding Help as a reference, so I basically just repeated what Headcrab Zombie said (in this situation), because I think he knows what he is doing.
http://forum.blockland.us/index.php?topic=260618.msg7623408#msg7623408
I was simply restating things that were previously said, and assumed they were right.

Alright guys so I followed a lot of the advice but the Blockland console keeps telling me I have the same syntax error in line one. I doubt its the way that the script is being saved as its a folder. The script is called client.cs and its alongside a description.txt so I dont know whats wrong. Sorry for the ignorance, Ive just started looking into torque.

Then show us what you got out of everyone's advice.


package chatbot
{
function clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
 {
parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
   if (%msg $= "Zazzlebot")
   {
      if (%name $= $Pref: :Player: :Netname)
      {   
      commandtoserver('messagesent', "Yissir");
      }
   }
};
activatepackage(chatbot);



I didnt want to make it too complicated since its just a start. I just kept some things in mind

Well in your function you have three {'s and only two }'s, so in your code you never close the function.

I've been reading through the last couple of pages of Coding Help as a reference, so I basically just repeated what Headcrab Zombie said (in this situation), because I think he knows what he is doing.
http://forum.blockland.us/index.php?topic=260618.msg7623408#msg7623408
I was simply restating things that were previously said, and assumed they were right.
He was talking about something else, and I missed the point. I think you missed it too, read port's posts further down.

He was talking about something else, and I missed the point. I think you missed it too, read port's posts further down.
I didn't even see ports post, thanks for pointing it out.

Okay i feel embarrassed for asking once again. I checked through and now I have no idea whats wrong.

package chatbot
{
function clientcmdchatmessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
 {
parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg);
   if (%msg $= "Zazzlebot")
   {
      if (%name $= $Pref: :Player: :Netname)
      {   
      commandtoserver("messagesent", "Yissir");
      }
   }
}
};
activatepackage(chatbot);

I made sure that all brackets are closed and that I have semicolons in the right places. I checked for spelling errors  and misplaces symbols but I cant seem to find anything else. I apologize for the inconvenience. Thank you for any further support.

If anyone could tell me a program that could notify me about unexpected pieces of script that would be great. I have a mac

if (%name $= $Pref: :Player: :Netname)

No need to feel embarrassed, this should be $Pref::Player::NetName not $Pref: :Player: :NetName

Thanks. Ill make sure to write down everything. Im planning to continue scripting in the future

No need to feel embarrassed, this should be $Pref::Player::NetName not $Pref: :Player: :NetName

I thought torque didnt register spaces?

I thought torque didnt register spaces?

Where did you hear that?