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


Joined: 14 Apr 2003
Posts: 4
Location: Australia

PostPosted: Tue Apr 15, 2003 2:33 am   

a few #IF's
 
hello,

zMUD 6.4 and i have an alias to put some targets into a string:

#AL tar {
#IF %1=%null {#EC TAR TARGETNAME;#EC TAR BASH;#EC TAR CLEAR}
#IF %1 {#ADDI target_list %-1}
#IF %1=bash {#FO @target_list_bash {#ADDI target_list %i}}
#IF %1=clear {target_list=%null}
#DELI target_list bash
#DELI target_list clear
}

if you type TAR it echo's some examples
if you type TAR PIG it will add pig to the list
if you type TAR BASH it will add another string to the target list
if you type TAR CLEAR is will erase the target list

my problem is when you type TAR to get help
it clears adds the bash string and then clears
the target list, have i done something wrong?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Apr 15, 2003 5:51 am   
 
Delimiters (parentheses, brackets, quotes, etc) are your friends. Use them.
#AL tar {
#IF (%1=%null) {#EC TAR TARGETNAME;#EC TAR BASH;#EC TAR CLEAR}
#IF (%1) {#ADDI target_list {%-1}}
#IF ("%1"="bash") {#FO @target_list_bash {#ADDI target_list {%i}}}
#IF ("%1"="clear") {target_list=%null}
#DELI target_list bash
#DELI target_list clear
}



LightBulb
Advanced Member
Reply with quote
lYPh
Newbie


Joined: 14 Apr 2003
Posts: 4
Location: Australia

PostPosted: Tue Apr 15, 2003 6:19 am   
 
brilliant, thanks
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