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
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Jan 05, 2004 12:42 am   

Passing Parameters
 
Alias name: Boar
Value:
#IF (%numparam( )>0) {#if (%numparam=2) {ink boar on %param(2) of %param(1);#NOOP};#if (%numparam=3) {#math bodypart %param(2)+" "+%param(3);ink boar on @bodypart of %param(1);#NOOP}} {outr purple ink;outr red ink;outr red ink;ink boar on head}

I was wondering if there was an easier/faster way to do this, possibly without a variable. The syntax for this alias is BOAR PLAYERNAME BODYPART. As you can see, the bodypart can be multiple words.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jan 05, 2004 1:07 am   
 
Aliases treat each word (words are defined as a string of letters and symbols separated by spaces) as one parameter:

Alias %1 %2 %3 etc

If you have parameters which are more than one word, you have two options depending on where the multi-word parameter lies:

Alias %1 %2 %-3 //if the multi-word parameter is at the very end of the list, %-3 will capture everything from the 3rd word onward: Alias this is a test

Alias %1 "%2" %3 //if the multi-word parameter is in the middle or front of the list, you need to use quotes or other kind of braces, which will force ZMud to treat that multi-word parameter as a single-word parameter: Alias this "is a" test
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Jan 05, 2004 1:39 am   
 
Thanks, I figured there was a much easier way.
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