Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
etrin
Newbie


Joined: 01 May 2002
Posts: 5

PostPosted: 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
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: 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 ().
Reply with quote
etrin
Newbie


Joined: 01 May 2002
Posts: 5

PostPosted: Wed May 01, 2002 3:18 pm   
 
Thank you very much I will try this as soon as I get home.

thanks again
etrin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
etrin
Newbie


Joined: 01 May 2002
Posts: 5

PostPosted: 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
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 05, 2002 7:51 am   
 
Turn off Show Triggers in your Script Parser Preferences.

LightBulb
Vague questions get vague answers
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net