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
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.
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.
To make your code more readable please use [code] tags as described here.
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.
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.
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.