Register forum user name Search FAQ

Gammon Forum

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 ➜ Help with Prompt Triggers

Help with Prompt Triggers

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ineedhelp   (3 posts)  Bio
Date Mon 01 Apr 2002 02:42 AM (UTC)
Message
I am trying to build a trigger that will set off based on your trigger. The trigger is suppose to set off when it sees this:

<44/44hp 121/121m

If it matters, my entire prompt is this:

<44/44hp 121/121m 112mv 950xps>

I have it set up to do this when it is - supposed - to trigger:

wake
cast 'detect invis'
get jerky
get jerky
eat jerky
eat jerky
drink water
drink water
sleep
afk

Here is the problem: For some reason, even though the <44/44hp 121/121m shows up in my prompt, the trigger doesn't fire off. Why?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 01 Apr 2002 06:23 AM (UTC)
Message
Can you tell us what trigger you have, ie. the trigger text? Have you got "regular expressions" checked?

If you are trying to match on exactly:


<44/44hp 121/121m


then you need a trailing wildcard, otherwise it will match on that, but not with something more on the line.

ie. Your trigger would be:


<44/44hp 121/121m*


The asterisk is a wildcard.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ineedhelp   (3 posts)  Bio
Date Reply #2 on Mon 01 Apr 2002 08:11 AM (UTC)
Message
The original text for a prompt is this:

<%h/%Hhp %m/%Mm %vmv %xxps> =
<44/44hp 121/121m 112mv 924xps>

I have tried the trailing wildcard, and it still doesn't work. I can run the trigger with everything on the prompt, but when I move down in xps, the trigger doesn't work anymore, due to the xps amount changing.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 01 Apr 2002 10:08 PM (UTC)
Message
You haven't said what the trigger itself is.

I presume that:


<%h/%Hhp %m/%Mm %vmv %xxps> =


... is simply what you tell the MUD to display. As a trigger that wouldn't match anything.

The trigger would need to be something like:


<*/*hp */*m *mv *xps>*


The asterisk in each case matches the "unknown" (ie the number) that will change each time.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ineedhelp   (3 posts)  Bio
Date Reply #4 on Tue 02 Apr 2002 07:41 PM (UTC)
Message
I have placed the following as my trigger, none of them has worked:

<44/44hp 121/121m*
<*/*hp */*m *vmv *xps>

In both cases I have toggled "Regular Expressions" on and off, to check to see if they would work,

The %h/%H and so on, are just code to tell the mud what to put in (%h = the currant amount of Hit Points you have, while %H = the maximum amount of Hit Points you have.)

If it helps. I want my trigger set with my prompt, so that my character will cast two spells, when both hp, and mana, are both at their max. (44/44hp 121/121m.)

Then, obviously, the trigger will not fire off again, until my character regens up to full hp - and - mana again.

Obviously, the number behind the '/' is a set number, as that is your max hp and mana. The number before the '/' is the one that changes.

Though I am sure I am completely wrong...would the following work?

<*/44hp */121m

As the wildcard sets the number changing, and compares it to the set number?

Just a guess..and if you have a migrane due to my failure to understand..I am sorry :)
Top

Posted by Dubthach   (47 posts)  Bio
Date Reply #5 on Tue 02 Apr 2002 10:21 PM (UTC)
Message
Set the trigger to this:
<*/*hp 121/121m *mv *xps> = *

Check "keep evaluating".

Put your bot info in. That should work, I tested it on Mirk. Send me a tell there (Bleys) if you can't get it going.

HTH,
Dub.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Tue 02 Apr 2002 11:22 PM (UTC)
Message
Quote:

Though I am sure I am completely wrong...would the following work?


<*/44hp */121m


As the wildcard sets the number changing, and compares it to the set number?


Almost, but you need a trailing asterisk to catch "the rest of the line".


<*/44hp */121m*


These examples are not regular expressions, so leave that unchecked.

Finally, when testing these, prompt triggers are not matched until a "newline" character is received, so they won't match until something else arrives.

In other words:


<44/44hp 121/121m 112mv 950xps> (cursor here)


... won't match (yet). The trigger matching is done when the line has completely arrived. If you are testing, press <enter> to force a new line. eg.


<44/44hp 121/121m 112mv 950xps>
(cursor here)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


18,977 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.