Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Jscript
➜ doAfterSpecial Error
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Avian
(7 posts) Bio
|
| Date
| Sat 13 Jan 2007 09:37 AM (UTC) |
| Message
| What does this error mean...?
Expected ')'
Line in error:
world.doAfterSpecial(4,"setVariable("flagAction","false");",12);
I tried using \ on the setVariable marks, but... no good. | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Sat 13 Jan 2007 11:50 AM (UTC) |
| Message
| Looks like you need to escape the inner quotes, like so:
world.doAfterSpecial(4,"setVariable(\"flagAction\",\"false\");",12);
Is that what you meant about putting a \ in front of the marks? Could you show exactly what you did? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Avian
(7 posts) Bio
|
| Date
| Reply #2 on Sat 13 Jan 2007 07:41 PM (UTC) |
| Message
| world.setVariable("flagAction","true");
world.send("shatter left arm @x");
world.doAfterSpecial(4,"setVariable(\"flagAction\",\"false\");",12);
That's my exact code. Variables are expanded... and it's a regular expression alias with ^sla$ as the command.
It sends to Script. | | Top |
|
| Posted by
| Avian
(7 posts) Bio
|
| Date
| Reply #3 on Sat 13 Jan 2007 07:44 PM (UTC) |
| Message
| | I also tried escaping the parentheses and the semicolon... no good either. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,169 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Sun 14 Jan 2007 03:31 AM (UTC) |
| Message
| The problem here is that in "send to script", MUSHclient expands out backslashed sequences itself, before passing the text to the script engine. Thus you have to double-escape it. This worked for me:
world.setVariable("flagAction","true");
world.send("shatter left arm @x");
world.doAfterSpecial(4,"setVariable(\\"flagAction\\",\\"false\\");",12);
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Avian
(7 posts) Bio
|
| Date
| Reply #5 on Sun 14 Jan 2007 04:29 AM (UTC) |
| Message
| |
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,238 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top