Help with Prompt Triggers

Posted by Ineedhelp on Mon 01 Apr 2002 02:42 AM — 7 posts, 25,824 views.

#0
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?
Australia Forum Administrator #1
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.
#2
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.
Australia Forum Administrator #3
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.
#4
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 :)
#5
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.
Australia Forum Administrator #6
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)