Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Trigger using * but wanting it to trigger only if one * equals another *
Trigger using * but wanting it to trigger only if one * equals another *
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Michaelmj11
(11 posts) Bio
|
Date
| Fri 19 Oct 2007 07:42 PM (UTC) |
Message
| 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.
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sat 20 Oct 2007 12:01 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Sat 20 Oct 2007 01:09 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Michaelmj11
(11 posts) Bio
|
Date
| Reply #3 on Sun 21 Oct 2007 02:49 AM (UTC) |
Message
| Thank you, that worked perfectly. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
12,956 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top