|
lYPh Newbie
Joined: 14 Apr 2003 Posts: 4 Location: Australia
|
Posted: 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? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
lYPh Newbie
Joined: 14 Apr 2003 Posts: 4 Location: Australia
|
Posted: Tue Apr 15, 2003 6:19 am |
brilliant, thanks
|
|
|
|
|
|