| 
	
		|  |  
		| kgruenwald Newbie
 
 
 Joined: 05 Feb 2007
 Posts: 2
 
 
 | 
			
			  |  Posted: Mon Feb 05, 2007 4:40 am 
 Converting skill counting script from ZMud 7.21 to CMud 1.24
 
 |  
				| Pattern: * You think your %1 skill has improved. * Values: #cw 23
 #cap skills
 #ad %replace( %replace( %replace( "%1", "'", "_"), " ", "_"), "#", "_") 1
 %1 @%1
 show skills %1 <>
 
 In ZMud, the "%1 @%1" shows skill name and the number of skill improves, ie testing 243
 
 In CMUd, it shows skill name@skill name.
 
 How do I get it to show the data as it does in ZMud?
 
 There are variables stored for each skill as it is first improved.
 |  |  
	  |  |  
		|  |  
		| MattLofton GURU
 
 
 Joined: 23 Dec 2000
 Posts: 4834
 Location: USA
 
 | 
			
			  |  Posted: Mon Feb 05, 2007 6:15 am 
 |  
				| First, use %concat().  Second, indirect referencing needs brackets now. 
 %concat(%1," ",@{%1})
 |  |  
	  | 
		    
			  | _________________ EDIT: I didn't like my old signature
 |   |  |  
		|  |  
		| Fang Xianfu GURU
 
  
 Joined: 26 Jan 2004
 Posts: 5155
 Location: United Kingdom
 
 | 
			
			  |  Posted: Mon Feb 05, 2007 6:28 am 
 |  
				| Also, %1 might not work in the trigger pattern - it's not actually a valid wildcard. Check out the pattern matching help topic, it lists proper wildcards and you need brackets around them to capture them. 
 (You also don't need the * before and after the pattern. CMUD will match part-lines and they'll slow down the matching - if you wanted to colour the whole line just use #color.)
 
 Finally, in your innermost nested replace you have %1 in quotes - this makes cmud try to do your replaces on the literal string %1, which obviously isn't what you're after. Remove the quotes to have CMUD substitute the wildcard for you. If you run the compatability report from the tools menu it'll flag common things like this for you.
 |  |  
	  |  |  
		|  |  
		| kgruenwald Newbie
 
 
 Joined: 05 Feb 2007
 Posts: 2
 
 
 | 
			
			  |  Posted: Mon Feb 05, 2007 2:13 pm 
 |  
				| Awesome. Thanks guys.  It's working great now. 
 |  |  
	  |  |  
		|  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |  |