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 ➜ Multiline trigger help

Multiline trigger help

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


Posted by Meredin   (13 posts)  Bio
Date Wed 25 Jan 2006 01:08 AM (UTC)
Message
I know there are lots of helpfiles about this, but none have been able to answer my question yet.

I'm sure it's only a horrible design that has led me to my problem, but occasionaly I run myself into a never ending loop that goes like this:

You come out of your trance.
trance
You enter a peaceful trance, collecting mana from the cosmos.

You come out of your trance.
trance
You enter a peaceful trance, collecting mana from the cosmos.

The problem is, that trance is sent to output from my trigger whenever I come out of my trance, the loop occurs if I am already trancing and then the trigger hits, which happens less than once a day, but still it happens and nothing stops it. This occurs because if I am alraedy trancing, and I send trance, it says taht I come out of my trance... Well you see why it is a never ending loop... Anyways... trance is only an output, but it echos... I ahve tried using the above three lines (cosmos is not it's own line) and I have also tried without using trance, triggering just off the first two lines. Neither works...

Here's the trigger I've been trying...

<triggers>
<trigger
enabled="y"
group="Multi Line"
ignore_case="y"
lines_to_match="3"
keep_evaluating="y"
match="You come out of your trance\.\ntrance\nYou collapse into a deep sleep\.\Z"
multi_line="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>sleep
wake
look
look
trance</send>
</trigger>
</triggers>

I have tried this trigger inserting a carrot at the beginning of the trigger, as in some of the examples, and have also tried putting the extra escape sequence before the \Z, as in some of the other problems people have ran into, and of course I have tried donig both of these at the same time. Nothign I have yet tried will make this trigger hit when the above three lines show up on my screen, and I think it has something to do with trance being an input that is echoed. Anyways, hope someone can help!! Thanks!!
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 25 Jan 2006 04:05 AM (UTC)
Message
You are right in guessing your problem is partly that the line "trance" is input and not sent from the MUD.

As is documented for triggers, they match on what arrives from the MUD, including multi-line ones. Any input you happen to sandwich inbetween those lines is not tested.

A method of stopping this loop you describe would be to simply detect the time in your trigger script, and code in such a way that you don't end more than one "trance" command in (say) 10 seconds.

BTW - the thing you put at the start of the line is a carat - a carrot is what rabbits eat. :)

- Nick Gammon

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

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #2 on Thu 26 Jan 2006 01:19 AM (UTC)
Message
Nick, that was so cute. Carrot... Carat...

Made me laugh so hard.
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.


15,554 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.