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
Ayclaes
Newbie


Joined: 31 Mar 2005
Posts: 9

PostPosted: Tue Jan 24, 2006 2:15 am   

Alias parameter question
 
#ALIAS apunch {#T+ punch;#RESET (punch|counter);#IF (%numparam == 3) {punch_uses = %3}{punch_targ = %1 %2};#IF (%numparam == 2) {#IF (%isnumber( %2)) {punch_uses = %2;punch_target = %1} {punch_target = %0}};#ECHO targ: @punch_target uses: @punch_uses;punch @punch_targ}

Is there a way to clean this up or expand it for n parameter testing?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jan 25, 2006 3:12 pm   
 
There is probably someway to make this cleaner but here is an idea:
Code:

#ALIAS apunch {
  #T+ punch
  #RESET (punch|counter)
  #VAR punch_targ %null
  #VAR punch_uses %null
  #LOOP %eval( %numParam( )-1) {#var punch_targ %concat(@punch_targ, " ", %Param( %i))}
  #VAR punch_uses %Param( %numParam( ))
  #ECHO @punch_targ / @punch_uses
  #NOOP To dump alias parameters sent.
}
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