 |
Loto Apprentice
Joined: 05 May 2003 Posts: 194
|
Posted: 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. |
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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}
|
|
|
|
 |
Loto Apprentice
Joined: 05 May 2003 Posts: 194
|
Posted: Sun Apr 25, 2004 7:43 pm |
It doesnt work... :(
|
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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} |
|
|
|
 |
Loto Apprentice
Joined: 05 May 2003 Posts: 194
|
Posted: Sun Apr 25, 2004 9:09 pm |
It captures the variables like it should but it doesnt synchronize.
|
|
|
|
 |
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: 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 |
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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} |
|
|
|
 |
|
|
|