  | 
	
	
	
		kinson Beginner
 
  Joined: 26 Aug 2002 Posts: 17 Location: USA
  | 
		
		  
			
			   Posted: 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. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		DeReP Adept
 
  Joined: 14 Jun 2003 Posts: 222 Location: Chile
  | 
		
		  
			
			   Posted: 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.
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		kinson Beginner
 
  Joined: 26 Aug 2002 Posts: 17 Location: USA
  | 
		
		  
			
			   Posted: Wed Jan 21, 2004 10:50 pm      | 
			 
			
				I considered that, but like you said, decided not to for security reasons.
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Talahaski Enchanter
 
  Joined: 10 Oct 2000 Posts: 656 Location: USA
  | 
		
		  
			
			   Posted: 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. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		kinson Beginner
 
  Joined: 26 Aug 2002 Posts: 17 Location: USA
  | 
		
		  
			
			   Posted: 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? | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Kjata GURU
  
  Joined: 10 Oct 2000 Posts: 4379 Location: USA
  | 
		
		  
			
			   Posted: 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 *.$ | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		| 
		
		 | 
	
	
		 |