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
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Sun Apr 25, 2004 6:09 pm   

Synchronizing on MUD prompt?
 
My MUD prompt can look like any of these:

* HP:Healthy SP:Full MV:Strong >
* HP:Healthy SP:Full MV:Strong - Dannear: Healthy - a lioness: Healthy >
* HP:Healthy SP:Full MV:Strong - a lioness: Healthy >

How would I set up a trigger to make it that when my HPS or MVS went up the timer synchronized?

The levels for HP are:

Healthy
Scratched
Hurt
Wounded
Battered
Beaten
Critical

The levels for MVs are:

Fresh
Full
Strong
Tiring
Winded
Weary
Haggard
Collapsing

I'm pretty sure this would use #IF but I have no idea how it would work.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 25, 2004 6:48 pm   
 
#TRIGGER {HP:(%w) SP:(%w)} {hp=%1;sp=%2;#If ((%1!=@hp) OR %2!=@sp) {#TS}} {prompt|nocr}
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Sun Apr 25, 2004 7:43 pm   
 
It doesnt work... :(
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 25, 2004 8:17 pm   
 
Try it as this
#TRIGGER {HP:(%w) SP:(%w)} {hp=%1;sp=%2;#If ((%1!=@hp) OR (%2!=@sp)) {#TS}} "" {prompt|nocr}
Reply with quote
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Sun Apr 25, 2004 9:09 pm   
 
It captures the variables like it should but it doesnt synchronize.
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Sun Apr 25, 2004 10:16 pm   
 

#VARIABLE health {Critical|Beaten|Battered|Wounded|Hurt|Scratched|Healthy}
#VARIABLE movepts {Collapsing|Haggard|Weary|Winded|Tiring|Strong|Full|Fresh}
#VARIABLE oldhp 0
#VARIABLE newhp 0
#VARIABLE oldmv 0
#VARIABLE newmv 0
#TRIGGER {HP:(%w) SP:(%w)} {newhp = %ismember(%1,@health);newmv = %ismember(%2,@movepts);#IF ((@newhp > @oldhp) | (@newmv > @oldmv)) {#TS};oldhp = @newhp;oldmv = @newmv} "" {prompt|nocr}

Jesse
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 25, 2004 11:23 pm   
 
*whap self* ok I see what I did wrong :P My trigger will work if you switch saving the variables after the #IF and also if I use the correct pattern and stuff. Sorry I didnt catch it earlier

#TRIGGER {HP:(%w) SP:(%w) MV:(%w)} {#If ((%1!=@hp) OR (%3!=@mv)) {#TS};hp=%1;sp=%2;mv=%3} "" {prompt|nocr}
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