|
dime Novice
Joined: 15 Dec 2002 Posts: 35
|
Posted: Sun Dec 15, 2002 5:50 pm
syntax error #say @var. |
greetings all.. new to zmud scripting.. lots of commands i don't know and am too lazy to look up right now.. anyways, i wrote a small script to replace a stat line.. it works... except it says there's a syntax error because i put a . after the variable @stats
in the (i guess it's called the debug window).. it shows ^ syntax error with the ^ pointing at the ; before the #color white command... but it has nothing to do with the ;#color white.. because even if i removed that, it simply points to the empty space after @stats.
#TRIGGER {Your base abilities are: Str:(%d) Int:(%d) Wil:(%d) Dex:(%d) Con:(%d).} {#GAG;#MATH stats (%1+%2+%3+%4+%5);#SAY Your base abilities are: Str:%1 Int:%2 Wil:%3 Dex:%4 Con:%5 Total:@stats.;#COLOR WHITE}
before and after:
Your base abilities are: Str:15 Int:12 Wil:11 Dex:14 Con:15.
Your base abilities are: Str:15 Int:12 Wil:11 Dex:14 Con:15 Total:67.
edit: forgot to mention that if i removed the period, the syntax error goes away, but of course, there's no period at the end, and i would like there to be.. thanks for your time all.. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 15, 2002 6:11 pm |
Is this really necessary? The simplest approach would be to allow the MUD to supply the stats and just use the trigger to provide the total.
#TRIGGER {Your base abilities are: Str:(%d) Int:(%d) Wil:(%d) Dex:(%d) Con:(%d).} {#COLOR white;#MATH stats (%1+%2+%3+%4+%5);#SAY Your total stats are: @{stats}.;#COLOR WHITE}
The problem, of course, is that . is a legitimate character in variable names as long as it's not the first or last character, and zMUD is looking for the remainder of the variable name. You can use braces around the actual name to separate it from the period.
LightBulb
Senior Member |
|
|
|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Sun Dec 15, 2002 6:13 pm |
Try using {@stats}. - because there is no space between the 'stats' and the '.' its probably assuming you have a variable called 'stats.'
Lady C. |
|
|
|
dime Novice
Joined: 15 Dec 2002 Posts: 35
|
Posted: Sun Dec 15, 2002 6:16 pm |
thanks for the quick replies all.. it's not necessary.. but i would like this small personal touch on the stat line...
i have tried using braces..
#TRIGGER {Your base abilities are: Str:(%d) Int:(%d) Wil:(%d) Dex:(%d) Con:(%d).} {#GAG;#MATH stats (%1+%2+%3+%4+%5);#SAY Your base abilities are: Str:%1 Int:%2 Wil:%3 Dex:%4 Con:%5 Total:{@stats}.;#COLOR WHITE}
gave me this:
Your base abilities are: Str:15 Int:12 Wil:11 Dex:14 Con:15 Total:{67}.
edit:
i have also just tried..
#TRIGGER {Your base abilities are: Str:(%d) Int:(%d) Wil:(%d) Dex:(%d) Con:(%d).} {#GAG;#MATH stats (%1+%2+%3+%4+%5);#SAY Your base abilities are: Str:%1 Int:%2 Wil:%3 Dex:%4 Con:%5 Total:@{stats}.;#COLOR WHITE}
and it works, yet still gives me a syntax error.. same place.. |
|
|
|
dime Novice
Joined: 15 Dec 2002 Posts: 35
|
Posted: Sun Dec 15, 2002 6:23 pm |
lol.. sorry for such a lengthy post over such a small thing..
lightbulb.. i tried your method and it works, but so does mine... they both work, yet when you go to the settings, they both show syntax errors..
i guess i already have it set up the way i want it.. i was just curious as to why it shows a syntax error.. i'll stop trying to fix what isn't broken now.. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Dec 15, 2002 10:15 pm |
That particular syntax error has been corrected for the next public version. In the mean time put a tilde in front of the period.
@stats~. |
|
|
|
|
|