|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Mon Oct 14, 2002 6:56 am
simple one (hopefully) |
How come when I put in a varible to capture text with spaces I can't get the varible to get all the text instead it puts it in class and default.
IE
#TR {%W flees %2} {#var mob %1;#var dir %2}
output : green frog flees west
the var mob contains only green not green frog and puts frog as it's default. If there are 3 word names the 3rd word is the class...how do I stop this? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Oct 14, 2002 2:34 pm |
First, why it does it. The syntax for variables is:
#VAR variable value default-value classname
Your actual trigger probably uses %1 where you put %W, so you have:
#VAR mob green frog
which makes green the value and frog the default.
Now, to fix it. First, stop using %number in your patterns. Second, use the appropriate wildcards, such as %w, %d, *, etc. instead, and use parentheses around the portions of the pattern you want to use as parameters in the value portion of the trigger. Third, put {} or other delimiters around the various parts of commands, especially when you know they might include spaces. This gives the corrected trigger:
#TR {(*) flees (%w)} {#var mob {%1};#var dir {%2}}
which will produce the command:
#VAR mob {green frog}
with "green frog" as the value of the variable and no default-value.
LightBulb
Senior Member |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Mon Oct 14, 2002 4:40 pm |
Thanks Light Bulb it worked perfectly and corrected my sintax
needed that help |
|
|
|
EdwinDroom Wanderer
Joined: 25 Jan 2002 Posts: 77 Location: Ireland
|
Posted: Tue Oct 15, 2002 1:39 am |
Sintax? Has Pres Bush put a tax on sin now?
*GRIN*
"I've got an allergy to Perrier, daylight and responsibility" - Marillion
Check out Moral Decay on 131.247.113.1 3003 |
|
|
|
|
|