Script request

Posted by Omega on Wed 21 Dec 2005 05:07 AM — 3 posts, 16,324 views.

#0
I'm trying to get this thing to work on the mud I play. Basically, there are 12 different things that can be triggered for the same failure.

You turn up empty-handed, despite your best efforts.
You spot a few likely-looking plants, but none turns out to be suitable.
You search diligently, but can't remember how to find what you're looking for.
You search all around, but find nothing.
You look in all the right places, but can't find anything.
You fumble around for a while but find nothing.
You find only a handful of half-rotted plants.
You find only a few half-rotted plants.
You find only a few blighted plants.
You fail to find anything usable.
You can't seem to find anything useful here.
You can't find anything that looks like what you want.

I want to be able to make a trigger that I only have to make 1 trigger for, that way I can go in and manually change what I want to gather. Unless, of course, you can get it to repeat the last command that was inputted, such as "gather strawberry", or the universal command "forage".

Thanks.
Canada #1
Type an one of these in your mud. --> ! <--
On most muds the exclemation mark will repeat your last command. So if you set up that trigger to send one it would repeat the same one you used before.

-RL
Australia Forum Administrator #2
You want a regular expression with an "or" test, like this:

Match:

You turn up empty-handed, despite your best efforts\.|You spot a few likely-looking plants, but none turns out to be suitable\.| ... and so on

That will match on any string in the list. You need to escape special characters like periods with a backslash.

See this post for more details about regular expressions:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5089