 |
PrestoPimp Apprentice
Joined: 18 Sep 2001 Posts: 175 Location: USA
|
Posted: Sat Jan 12, 2002 4:56 am
Bad syntax error? |
I am using Zmud 6.16, I have a trigger entered in as follows:
Trigger:-(*)-xp
command:#IF (%1 < 10000){get guide @container;wear guide}
Then in the script portion it says:
#IF (%1 < 10000){get guide @container;wear guide}
^ syntax error
Is this a bug? or am I entering the #IF statement in wrong? I checked the syntax in the help file and it says what I'm doing is right.. What the dealeo?
For tomarrow is another day, and other days come but 6 times a week. |
|
|
|
 |
PrestoPimp Apprentice
Joined: 18 Sep 2001 Posts: 175 Location: USA
|
Posted: Sat Jan 12, 2002 6:08 am |
Ok I got the thing to work by giving no tags for the commands.. but what I do as far as the else state goes?
For tomarrow is another day, and other days come but 6 times a week. |
|
|
|
 |
PrestoPimp Apprentice
Joined: 18 Sep 2001 Posts: 175 Location: USA
|
Posted: Sat Jan 12, 2002 7:59 am |
Nevermind I fixed it
For tomarrow is another day, and other days come but 6 times a week. |
|
|
|
 |
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Sat Jan 12, 2002 8:51 am |
For those still pondering this, it appears to be caused by the lack of a space between the right parenthesis of the condition expression and the left brace of the action.
Troubadour  |
|
|
|
 |
PrestoPimp Apprentice
Joined: 18 Sep 2001 Posts: 175 Location: USA
|
Posted: Sat Jan 12, 2002 9:09 am |
Actually.. Not only was it that lack of space.. but I had to have it do a format like:
#IF (blahblah) {
command1
command2
command3
} {elseblah}
kinda weird.. because the first thing I had contained the spaces but it still gave me a syntax error. :P
For tomarrow is another day, and other days come but 6 times a week. |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sat Jan 12, 2002 10:31 am |
Note the use of a space exactly where Troubadour said in PrestoPimp's solution post.
|
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jan 12, 2002 7:55 pm |
quote:
#IF (%1 < 10000){get guide @container;wear guide}
He meant the space that's supposed to be between the ending ) and the beginning { of the true section of the #IF. Your trigger should have looked like this:
#IF (%1 < 10000) {get guide @container;wear guide}
This would have caused ZMud to automatically put each command in the true section on its own line like you ended up. If you try to position things manually, like this:
#if (blah blah blah) {
#say blah
#say yakety
}
Then Zmud will throw you a syntax error (if you have pretty print turned on) because #SAY blah was not immediately following the opening {.
li'l shmoe of Dragon's Gate MUD |
|
|
|
 |
PrestoPimp Apprentice
Joined: 18 Sep 2001 Posts: 175 Location: USA
|
Posted: Sat Jan 12, 2002 9:21 pm |
Thank you smartarses :P I know I know.. Troubadour is god I am lam0r All bow to Troubadour. *cowers* :P
For tomarrow is another day, and other days come but 6 times a week. |
|
|
|
 |
|
|
|