[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  trouble with trigger

trouble with trigger

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


Posted by Milty111   USA  (4 posts)  [Biography] bio
Date Mon 10 Apr 2017 02:26 AM (UTC)
Message
new to Mush and trying to make a simple trigger.
There's a "marble fountain"...some type before and after those words so I made it trigger on * marble fountain * then the command "drink fountain". The problem is that even though it worked, it went into a loop and get drinking repeatedly. Any idea why it might do that?
Thanks
[Go to top] top

Posted by hogarius   USA  (22 posts)  [Biography] bio
Date Reply #1 on Mon 10 Apr 2017 04:09 AM (UTC)

Amended on Mon 10 Apr 2017 04:10 AM (UTC) by hogarius

Message
I'm guessing that when you send the command "drink fountain" to the game, the game responds by saying something like, "You drink from a marble fountain in the middle of the square." This matches the trigger you have set up with "* marble fountain *" as a pattern.

To prevent a loop, you need to modify the trigger pattern so it matches when there is a fountain in the room, but doesn't match when you drink from the fountain.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Mon 10 Apr 2017 06:50 AM (UTC)
Message
I agree with hogarius. Milty111, if you need help, you can copy/paste enough output from your game, starting from just before you see the fountain until just after you drink from it, and we can help you figure out a better trigger pattern.

Template:codetag To make your code more readable please use [code] tags as described here.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Milty111   USA  (4 posts)  [Biography] bio
Date Reply #3 on Mon 10 Apr 2017 04:40 PM (UTC)
Message
So here's what I found
This is in the room description:
A marble fountain covered in moss is here.

My trigger of * marble fountain * activates the command:
drink fountain

As you suspected, the drink action creates output from the game as follows which reactivates the trigger and throws me into a loop:
You drink from a marble fountain covered in moss in the room.
[Go to top] top

Posted by hogarius   USA  (22 posts)  [Biography] bio
Date Reply #4 on Tue 11 Apr 2017 01:31 AM (UTC)

Amended on Tue 11 Apr 2017 02:27 AM (UTC) by hogarius

Message
I suggest making your trigger pattern simply...

A marble fountain covered in moss is here.

Don't use any wildcards in this case. This will make your pattern specific enough to match when you see the fountain, but not match when you drink from the fountain.
[Go to top] top

Posted by Milty111   USA  (4 posts)  [Biography] bio
Date Reply #5 on Tue 11 Apr 2017 09:22 AM (UTC)
Message
That was the very first thing I tried and I also just now tried it again but sad to say it doesn't work for me.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 11 Apr 2017 08:15 PM (UTC)
Message
Please copy and paste your simple trigger here:

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Milty111   USA  (4 posts)  [Biography] bio
Date Reply #7 on Tue 11 Apr 2017 09:13 PM (UTC)
Message
<triggers>
<trigger
enabled="y"
match="A marble fountain covered in moss is here."
sequence="100"
>
<send>drink fountain</send>
</trigger>
</triggers>
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #8 on Sun 23 Apr 2017 05:52 AM (UTC)
Message
What I suggest is both more complicated and more elegant at the same time. Create 2 more triggers, one based on your drinking message that disables the original trigger to drink from the fountain, the other to enable the drinking trigger based on whatever thirst messages your mud provides. This has the added benefit of only drinking from fountains when you actually need to do so and cutting down on the overall spam generated by doing so.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] 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.


22,899 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]