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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kinson
Beginner


Joined: 26 Aug 2002
Posts: 17
Location: USA

PostPosted: Wed Jan 21, 2004 10:23 pm   

Variables and Braces/Double Quotes
 
I am using Zmud 6.62.

Here is my trigger pattern:

^* is auctioning (*) ~(Level *, Num (%d)~). Current bid is *.$

The first action I perform is:

#VAR db_obj_name {%1} _nodef datamine

This works well until the data I'm trying to capture contains a { or a } symbol. If I change it to:

#VAR db_obj_name "%1" _nodef datamine

it solves /that/ problem, but then if the data I'm trying to capture contains a double quote ("), it bombs on me again.

I even investigated using %literal, but that doesn't seem to help me either. Is there another command/function I'm missing that could help me write something that will accept both?

Thanks in advance.
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Wed Jan 21, 2004 10:48 pm   
 
You can try with the %* wildcard, will catch any zMUD special symbol but is risky for security reasons explained in some other threads.
Reply with quote
kinson
Beginner


Joined: 26 Aug 2002
Posts: 17
Location: USA

PostPosted: Wed Jan 21, 2004 10:50 pm   
 
I considered that, but like you said, decided not to for security reasons.
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Wed Jan 21, 2004 11:16 pm   
 
can you possible remove the " and { without effecting your scripts.

example.

^* is auctioning (*) ~(Level *, Num (%d)~). Current bid is *.$
#VAR db_obj_name {%replace(%replace(%1,"{" ""),"") _nodef datamine

not sure if this will work, but perhaps some alternative of this.
Reply with quote
kinson
Beginner


Joined: 26 Aug 2002
Posts: 17
Location: USA

PostPosted: Thu Jan 22, 2004 1:43 am   
 
I'm afraid I don't quite understand your example, as there is an opening brace but no closing brace. The %1 needs to either be in { } marks or " " marks, because if what I'm capturing is more than one word, and I don't use those symbols, only the first word will be stored in the variable.

Anyone else?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 22, 2004 2:09 am   
 
Use the &varname syntax to get the matched text straight to a variable and avoid having to expand %1:
^* is auctioning &db_obj_name ~(Level *, Num (%d)~). Current bid is *.$
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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