|
Skaphia Beginner
Joined: 18 Dec 2002 Posts: 27 Location: USA
|
Posted: Fri Apr 18, 2003 8:08 pm
special character problems? |
I am trying to create a variable that saves 4 different lines of text into 4 different variables. The lines of text all come up at once under one command and look like:
STR : 12(12)
INT : 14(13)
WIS : 15(12)
DEX : 11(11)
problem is when I try to use STR : %1(%2)as my trigger pattern and the commands as:
#VAR str %2 ...the variable saves the value as ) and not as 12. Can anyone help me with this please? I am on zmud 5.55 and cannot simply uncheck the special characters as they are not modifiable in that version. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Apr 18, 2003 9:29 pm |
You'll have fewer problems if you read the zMUD helpfiles and use standard zScript instead of stuff you learned with another client/language. Specifically, zScript uses wildcards and parentheses in the trigger pattern and numbered parameters in the trigger value. There's a link to the pattern matching symbols in the #TRIGGER helpfile, or it can be found from the Index under patterns.
In addition to listing and explaining all the wildcards, the Pattern Matching helpfile explains the use of the ~ quote character to prevent the following character from being parsed and provides numerous examples.
#TR {STR : (%d)~((%d)~)} {#VAR str1 %1;#VAR str %2}
Add spaces where needed
LightBulb
Advanced Member |
|
|
|
Mutt Newbie
Joined: 05 Apr 2003 Posts: 4
|
Posted: Sat Apr 19, 2003 2:25 am |
Granted I dont know much about zMud scripting yet (trying to learn fast), but wouldn't it be cleaner to do:
#TR {STR : (&str1)~((&str2)~)} {commands}
..? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 19, 2003 3:41 am |
quote:
Granted I dont know much about zMud scripting yet (trying to learn fast), but wouldn't it be cleaner to do:
#TR {STR : (&str1)~((&str2)~)} {commands}
..?
In this case, it's probably just as valid since it's reasonable to assume that the variable portions of the matched line will always be numeric. However, this trigger will STILL match the line (and now be useless) were the mud to implement textual numbers--one, two, three, et cetera instead of 1, 2, 3, etc.
&variable = (*) as far as trigger patterns go.
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|