|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Mon Aug 17, 2009 9:22 pm
Trigger on variable change |
hi,
i have triggers which capture my hpbar. when i'm fighting, the health status of the monster is shown and when i'm not, there's no status.
R:3/83% GH:H
R:3/83% GH:H E: close
E: close is already captured into a variable and gagged.
i want to perform an action on the round that "E: something" appears on the hpbar. 'something' can also be other things as the monster's health changes so i can't just set an expression trigger for the variable.
is there any way to do this? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Aug 18, 2009 1:27 pm |
Do you want to do this only with a specific value of "something", or any "something"?
|
|
|
|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Tue Aug 18, 2009 6:16 pm |
basically, i want to perform an action on the round when my hp goes from having no enemy status, to having an enemy status. and the 'something' for enemy status is not always the same. so i guess, any 'something'.
|
|
|
|
dak Beginner
Joined: 08 Aug 2009 Posts: 14
|
Posted: Wed Aug 19, 2009 1:46 am |
So, when capturing and gagging that variable:
Code: |
if var == something
perform an action on this round
end if |
The above is pseudo code. |
|
|
|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Wed Aug 19, 2009 7:10 am |
no, with that code, it'll fire every time the variable is something.
i only want it to fire on the round that the hpbar changes from R:3/83% GH:H to R:3/83% GH:H E: something.
the 'something' can be anything from another word to a digit depending on what i'm fighting. |
|
|
|
dak Beginner
Joined: 08 Aug 2009 Posts: 14
|
Posted: Wed Aug 19, 2009 8:00 am |
so have a variable keep track of what GH:H is, and when you fire to capture the variable, test to see if it changed.
Code: |
prev_var = previous value of hpbarvar
if var == something AND hpbarvar != prev_var
perform an action on this round
prev_var = hpbarvar
end if
|
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Aug 19, 2009 8:46 pm |
I can think of a couple other ways to do it, too. One would be to have a trigger watching for "E:" in the prompt, which fires the action, enables a second trigger, and disables itself. The second trigger then watches for a prompt without "E:" in it, enables the first trigger, and disables itself.
|
|
|
|
|
|