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
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 22, 2005 6:08 pm   

question
 
#TRIGGER {^(%d) hps~|(%d) sp~|(%d)} {%1 = @hp;%2 = @sp;%3 = @mp} "" "prompt"
#TRIGGER {^hp: (%d) sp: (%d) mp: (%d) {%1 = @hp;%2 = @sp;%3 = @mp}

I am still fairly new too zmud i was wondering if you could explain the reason for this line of scripting cause i don't understand..i would appreate the explanation. :)
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Wed Jun 22, 2005 6:16 pm   
 
Code:
#TRIGGER {^(%d) hps~|(%d) sp~|(%d)} {%1 = @hp;%2 = @sp;%3 = @mp} "" "prompt"
#TRIGGER {^hp: (%d) sp: (%d) mp: (%d) {%1 = @hp;%2 = @sp;%3 = @mp}

Basically what this does is store information from your prompt into variables: @hp, @sp, @mp
So if you receive from the mud
49 hps|50 sp|30
the first trigger will fire and store those numbers into each variable
If the prompt was
hp: 49 sp:50 mp: 30
It would do the same
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 22, 2005 6:26 pm   question
 
let me clarify i dont understand why the ^ (%d) hps~ if there is a helpfile that would help me with this i would appreate if ya posted it i may have over looked it.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Wed Jun 22, 2005 6:48 pm   
 
You want "Special Characters" and "patterns"

The (%d) tell zMUD to match a number and keep the value for later use.
The ~ is an escape character to tell zMUD that the next character is literal
The ^ tell zMUD to only match the pattern at the beginning of the line.
_________________
Barry
Gaidin @ 3k.org
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