 |
Digrat Newbie
Joined: 11 Nov 2002 Posts: 2
|
Posted: Mon Nov 11, 2002 8:18 pm
change in XP script |
I've got a trigger that reads XP from my prompt. I've got 3 variables: xpcurrent, xplast, and xpgained. What I'd like to do is run a script when the prompt trigger is run.
xpgained = xpcurrent - xplast
xplast = xpcurrent
Once I can get the xpgained into a variable, I can put it on the status line, BUT I'm having trouble figuring out where to put this script and how to script the two statements above.
Sorry, I know this is a basic question, but I'm a new scripter.
Thanks. |
|
|
 |
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: Mon Nov 11, 2002 8:40 pm |
Make a trigger, pattern is your prompt. Something like:
Pattern:
^(%n)Hp (%n)Sp (%n)Xp (%n)Kg>
Value:
xpcurrent = %3
#if (@xplast != %3) {xpgained = %eval(@xpcurrent - @xplast)}
xplast = @xpcurrent
Try that out.
Fat Tony |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Nov 12, 2002 4:24 am |
You only need two variables, xpcurrent and xpgained. Assuming %1 is your xp:
#MATH xpgained {%1 - @xpcurrent};#VAR xpcurrent %1
@xpcurrent isn't updated until AFTER xpgained is calculated, so there's no need for xplast.
LightBulb
Senior Member |
|
|
 |
Digrat Newbie
Joined: 11 Nov 2002 Posts: 2
|
Posted: Tue Nov 12, 2002 5:33 pm |
Thanks to fattony and Lightbulb. I got it to work using fattony's script; I tried Lightbulb's but it didn't work for me. My settings are:
Trigger pattern: &{hp}/&{hpmax}hp &{gp}/&{gpmax}gp &{xpcurrent}>
Trigger value: #if (@xplast != @xpcurrent) {xpgained = %eval( @xpcurrent - @xplast)}
xplast = @xpcurrent
This feeds my HP/Guild Point meter and puts the amount of XP the last action gave me into the status bar.
Thanks, folks!
-Digrat |
|
|
 |
|
|