Unknown2007-09-02 20:59:56
I actually have a couple of questions. I'm running on Vista, and zMUD apparently uses WinHelp (I haven't bothered downloading a viewer for it), so I can't see any of the zMUD help.
I'm working on creating an alias from within an alias. This is going to be used for a distributed offense system for my guild. Basically, I want to create something like this:
#alias addform {#IF (%null(%1) OR (%null(%2))) {#ECHO Correct syntax is: ADDFORM
I'm working on creating an alias from within an alias. This is going to be used for a distributed offense system for my guild. Basically, I want to create something like this:
#alias addform {#IF (%null(%1) OR (%null(%2))) {#ECHO Correct syntax is: ADDFORM
Unknown2007-09-03 00:42:17
%%1 and %%2 should work.
Unknown2007-09-03 18:03:39
QUOTE(Zarquan @ Sep 2 2007, 07:42 PM) 438184
%%1 and %%2 should work.
I tried this:
#if (%null( %1) OR %null( %2)) {i_alert SYNTAX: addform
#alias %2 {
#if (!%null( %%1)) {
#var ToPerform @target
#loop %%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
#addkey Forms %1 %2
}
In the resulting alias %%1 was just replaced with a blank space. I also tried this instead:
#if (%null( %1) OR %null( %2)) {i_alert SYNTAX: addform
#alias %2 {
#if (!%null( ~%1)) {
#var ToPerform @target
#loop ~%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
#addkey Forms %1 %2
}
In this case, the new alias was created, but the value in it only had "{#if "
Any ideas what I'm doing wrong?
Drathys2007-09-04 05:07:50
It appears that %%1 doesn't work inside an #if block.
It works if you remove the outer #if.
#alias %2 {
#if (!%null( %%1)) {
#var ToPerform @target
#loop %%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
creates the correct alias:
#if (!%null( %1)) {
#var ToPerform @target
#loop %1 {#add ToPerform kk}
#execute {kata perform @ToPerform}
}
It works if you remove the outer #if.
#alias %2 {
#if (!%null( %%1)) {
#var ToPerform @target
#loop %%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
creates the correct alias:
#if (!%null( %1)) {
#var ToPerform @target
#loop %1 {#add ToPerform kk}
#execute {kata perform @ToPerform}
}
Unknown2007-09-04 13:39:34
QUOTE(Drathys @ Sep 4 2007, 12:07 AM) 438566
It appears that %%1 doesn't work inside an #if block.
It works if you remove the outer #if.
#alias %2 {
#if (!%null( %%1)) {
#var ToPerform @target
#loop %%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
creates the correct alias:
#if (!%null( %1)) {
#var ToPerform @target
#loop %1 {#add ToPerform kk}
#execute {kata perform @ToPerform}
}
It works if you remove the outer #if.
#alias %2 {
#if (!%null( %%1)) {
#var ToPerform @target
#loop %%1 {#add ToPerform %2}
#execute {kata perform @ToPerform}
}
}
creates the correct alias:
#if (!%null( %1)) {
#var ToPerform @target
#loop %1 {#add ToPerform kk}
#execute {kata perform @ToPerform}
}
Interesting...
I can work around the if block to make it work. Thanks!