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
rtatum
Novice


Joined: 19 Sep 2004
Posts: 45
Location: Houston

PostPosted: Tue Aug 23, 2005 7:41 pm   

Simple command alias
 
Okay, say I want to make a command called test with anywhere from no parameters with no upper limit, or at least a large one...

For example, I'd like to be able to type test, and have it send just the command test, but if I type test one two three, it would send three separate commands: test one, test two, and test three... what would be the best way of accomplishing this? I've looked through the help and found the %numparam function, but I can't think of a way to do that... I've tried a few things with a while loop to no avail.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Aug 23, 2005 9:32 pm   
 
Look into the use of %param(). The example it shows in the helpfile is almost exactly what you are asking for.

#alias Test {#If (%numparam()) {#loop 1,%numparam() {~test %param(%i)};#noop} {~test}}
_________________
EDIT: I didn't like my old signature
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