 |
Petrograd Novice
Joined: 08 Dec 2005 Posts: 35 Location: Sweden
|
Posted: Mon Aug 20, 2012 11:22 am
Matching pattern with comma (,) in a list |
I match what I see on a line with a list of possible names like this:
^~<(%n)/(%n)hp 100/100m ~> (*)
Then depending on where I am (which I keep track of with the variable @stage) I want to keep going if the pattern in the (*) matches one of several rooms.
Ex:
#if (@stage == "midennir")&(%ismember( %3, A Creepy Corridor|Heart of the Black Forest|A Long, Cavernous Tunnel)) {walkpath}
The problem I have is that "A Long, Cavernous Tunnel" doesn't set the pattern off, despite being recorded properly. The comma is sorta grayed out in the trigger I think, so I'm guessing it's because the listing interprets the comma incorrectly. I tried adding (), {} or [] around the entire line with no success, as well as using ~ before the comma. I also tried putting the listed names in a variable and compare %3 to those, but that didn't work either.
Any ideas on how to solve this? |
|
|
 |
Petrograd Novice
Joined: 08 Dec 2005 Posts: 35 Location: Sweden
|
Posted: Thu Aug 23, 2012 12:09 pm |
I worked around it with extra triggers
like
#trigger {^~<(%n)/(%n)hp 100/100m ~> A Long, Cavernous Tunnel} {walkpath}
But that's not a generic solution to this problem :3 Any ideas? |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4735 Location: Pensacola, FL, USA
|
Posted: Thu Aug 23, 2012 12:40 pm |
The problem is you did not single out your anonymous variable with quotes or curly braces to signify it is all one item.
If that doesn't work, try:
%match(%3, {A Creepy Corridor|Heart of the Black Forest|A Long, Cavernous Tunnel}) |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|