|
etrin Newbie
Joined: 01 May 2002 Posts: 5
|
Posted: Wed May 01, 2002 2:00 pm
Please help with getting text from string |
Having a lot of fun with triggers but I ran into something I can't figure out.
IF the mud sends you
You got better at Hand to Hand!
How do I capture the "Hand to Hand" part of the string and save it to a variable?
I tried {better at(%w)}
and a few other things...I have forgotten what else. I tried so many things last night.
thanks for any advice on this, it looks simple enough.
Etrin |
|
|
|
dacheeba Adept
Joined: 29 Oct 2001 Posts: 250
|
Posted: Wed May 01, 2002 2:26 pm |
#TRIGGER {You got better at (*)!} {#VARIABLE pracgain %1}
In order to capture something from a trigger you have to 1.) make sure the pattern matches and 2.) makes sure that what you want captured is in (). |
|
|
|
etrin Newbie
Joined: 01 May 2002 Posts: 5
|
Posted: Wed May 01, 2002 3:18 pm |
Thank you very much I will try this as soon as I get home.
thanks again
etrin |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed May 01, 2002 3:21 pm |
Since you expect %1 to contain multiple words, you need braces around it in the #VAR statement.
#TRIGGER {You got better at (*)!} {#VARIABLE pracgain {%1}}
LightBulb
Vague questions get vague answers |
|
|
|
etrin Newbie
Joined: 01 May 2002 Posts: 5
|
Posted: Sun May 05, 2002 4:31 am |
#TRIGGER {become better at (*)!} {#VARIABLE better {%1}}
The variable better contains the correct string "hand to hand"
this is on my screen after the trigger works.
become better at hand to hand!
become better at (*)!
VARIABLE better {}
how do I suppress the trigger output?
just wanted it to say something like
=========You just got better at hand to hand==========
so I can catch if when fighting and all the spam on the screen.
I put the variable in the status bar so I could look down and see
what was happening so it now says you got better at hand to hand.
thanks very much for your help
now can zmud help me get gate to work for my warrior LOL
thanks again
etrin |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sun May 05, 2002 5:18 am |
You can always push it into a window
#TRIGGER {become better at (*)!} {#VARIABLE better {%1};#WIN skills %time(hh:nn) {%1}}
That would push all that information into
a window called skills and give you a time
stamp on it.
TonDiening
Beta Upgrading to 6.26 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun May 05, 2002 7:51 am |
Turn off Show Triggers in your Script Parser Preferences.
LightBulb
Vague questions get vague answers |
|
|
|
|
|