|
Haldrik Wanderer
Joined: 03 Sep 2007 Posts: 88
|
Posted: Mon Sep 10, 2007 11:28 am
Sending RegExpress Patterns to Variables? |
My code is this:
#Trigger- (wand|statue|orb|amulet|)
itemloot = 1
itemname = %1
#wait 1000
#T- Loot
look
#echo TestLoot
***********************************
I am getting an error- %1 Illegal token under Compiled Pattern. The weird part is this works elsewhere in my script...but is messing up in this trigger.
I think there is a better/easier way :P
I basically need whatever the causes the trigger to be put into a variable for later use.
Any Ideas? |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Mon Sep 10, 2007 1:06 pm |
Why do you have amulet|) instead of amulet)?
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Mon Sep 10, 2007 2:24 pm |
You need to use {} around | in CMud now.
#trigger ({wand|statue|orb|amulet}) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Sep 10, 2007 4:49 pm |
It's always been that way in CMUD and in zMUD, but not in regexes. The equivalent in regex is what Haldrik already has.
There's definitely a bug here though. I had a pattern as simple as (wand) fail to compile. |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Sep 10, 2007 6:21 pm |
Have you tried changing:
itemname = %1
for:
#VAR itemname %1 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Sep 10, 2007 8:55 pm |
This is a bug in handling string lists in Regular Expressions and has been added to the bug list.
|
|
|
|
|
|