trouble with trigger

Posted by Milty111 on Mon 10 Apr 2017 02:26 AM — 9 posts, 36,847 views.

USA #0
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
USA #1
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.
Amended on Mon 10 Apr 2017 04:10 AM by hogarius
USA Global Moderator #2
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.
USA #3
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.
USA #4
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.
Amended on Tue 11 Apr 2017 02:27 AM by hogarius
USA #5
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.
Australia Forum Administrator #6
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.
USA #7
<triggers>
<trigger
enabled="y"
match="A marble fountain covered in moss is here."
sequence="100"
>
<send>drink fountain</send>
</trigger>
</triggers>
USA #8
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.