Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Haldrik
Wanderer


Joined: 03 Sep 2007
Posts: 88

PostPosted: 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?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Sep 10, 2007 1:06 pm   
 
Why do you have amulet|) instead of amulet)?
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Sep 10, 2007 2:24 pm   
 
You need to use {} around | in CMud now.

#trigger ({wand|statue|orb|amulet})
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Sep 10, 2007 6:21 pm   
 
Have you tried changing:
itemname = %1
for:
#VAR itemname %1
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net