Trigger using * but wanting it to trigger only if one * equals another *

Posted by Michaelmj11 on Fri 19 Oct 2007 07:42 PM — 4 posts, 17,457 views.

#0
Ok here goes for a better explanation of what I am trying to do.

I want a trigger that will make me wake up once my stats have completely recovered.

So it looks like this when I am sleeping:

[4512/4512hp 0/12829en 505lv] (N) (...zzzz)

What I want, is for mush client to send “Wake” once my stats get to

[4512/4512hp 12829/12829en 505lv] (N) (...zzzz)

But I want it to continue working even after I gain a level and my stats change (and I don’t want to have to go in an adjust it every time. Unfortunately, I know about this much “–” about coding and scripting, and so what I have been trying to work out, is how to get

[*/*hp */*en *lv] (N) (...zzzz)

To work…

I have been thinking about something along the lines of:
%1=%2 and %3=%4 wake
… but I am unsure about how to implement this…





think i might have PARTIALY figured it out, by using: http://www.gammon.com.au/forum/?id=6030

but i am not sure.. it isn't really working as i thought... it would.. here is what i have entered into the actual triggers Send:

if %1 = %2 and %3 = %4
then
send ("wake")
end -- if


with this being in the Trigger:

[*/*hp */*en *lv] (N) (...zzzz)

any pointers would be greatly appreciated.


Australia Forum Administrator #1
Please don't post the same question twice in different threads, someone will answer in one thread, and someone in another, and we all get confused.

To solve your problem you don't really need scripting. See this thread:

http://www.gammon.com.au/regexp

Scroll down to "back references".

Using those (in a regular expression) you can check for current and max HP to be the same number, whatever that number is.
Australia Forum Administrator #2
Something along these lines is what I have in mind:


<triggers>
  <trigger
   custom_colour="1"
   enabled="y"
   match="^\[(\d+)\/\1hp (\d+)\/\2en (\d+)lv\] \(N\) \(\.\.\.zzzz\)$"
   regexp="y"
   sequence="100"
  >
  <send>wake</send>
  </trigger>
</triggers>


Here it is checking if hp and en are maxed, and lv is a wildcard.
#3
Thank you, that worked perfectly.