 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Aug 06, 2004 3:55 am
Comparison problem |
Put this together from another script i saw on here somewhere:
Code: |
#CLASS {autoheal}
#VAR canflee {0}
#TRIGGER {HP (%d)/(%d)} {
#IF (%1 < 75 and @canflee=1) {
canflee=0
.seese
sleep
}
#IF (%1 = %2 and @canflee=0) {
canflee=1
wake
.wnwwn
}
} "" {nocr|prompt}
#CLASS 0 |
Woked like a charm, right up until i reached 1000hps. Why? cause this is how it is displayed:
HP 1,000/1000
As you can see, there's a comma in there.
Tried to a few other ways, but nothing worked.
Granted, i can prolly get rid of the = comparison but making a timer, but was wanting something that would work no matter how much HP i had rather than need to adjust it when the timer is to short for a full heal. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Aug 06, 2004 4:41 am |
%n matches numbers which include commas, and also removes the commas.
#CLASS {autoheal}
#VAR canflee {0}
#TRIGGER {HP (%n)/(%n)} {
#IF (%1 < 75 and @canflee=1) {
canflee=0
.seese
sleep
}
#IF (%1 = %2 and @canflee=0) {
canflee=1
wake
.wnwwn
}
} "" {nocr|prompt}
#CLASS 0 |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Aug 06, 2004 4:46 am |
Thanks LB, was just about to say I found the solution in another post when i saw your answer :-)
Now, I just hope i remember it days from now when it comes up again :-) |
|
_________________
 |
|
|
 |
|
|