Option variables in triggers

Posted by AdInfinitum on Mon 18 May 2015 08:41 PM — 3 posts, 14,751 views.

#0
From what I can tell, it's not possible, but I want to double check before I give up on it. On a side note, it would be wonderful if this could work.

Essentially, I want to be able to create what I call "option variables" in triggers. I already know you can do something like:

^You get (?:@object) from a bag\.$


with "object" being a single item. But what if I want to search for multiple objects? Even if I set my variable to:

a sword|a dagger|a rabbit|some food


it doesn't work, as it's looking for the entire string, rather than an option from the string.

If it's not possible, could this be included in a future version?
Australia Forum Administrator #1
Change the variable to:


@!object


That stops the client "escaping" the special characters like | and then it will work.

i.e.


^You get (?:@!object) from a bag\.$
Amended on Mon 18 May 2015 08:52 PM by Nick Gammon
#2
Absolutely wonderful. Thanks!