|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Dec 11, 2006 3:18 am
[1.22] Aliases with auto append don't work like in zMUD |
This might be by design, because it is easier to understand the way that it works now compared with the way that it works in zMUD.
In zMUD, any arguments you gave to an alias that had several commands were appended to the last command (only) in the alias, provided that there were no instances of %1 or similar in the script of the alias. Earlier commands did not get the argument appended.
In CMUD, with auto append ticked (so for all aliases imported from zMUD), any arguments you give to the alias are appended to _every_ command in the alias, provided that there were no instances of %1 or similar in the script of the alias, or if there are instances of %1 in the alias script, the arguments are appended to _every_ command in the alias up until the first instance of %1 or similar is encountered. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Dec 11, 2006 3:41 am |
Ouch! Confirmed with a condition.
Make the following alias
Name: test
Script value:
line1
line2
#show Test line three.
#show Test line four. %1
line5
line6
Check the auto append and click save.
Now enter: Test hi there
The results:
line1 hi there
line2 hi there
Test line three.
Test line four. hi
line5 there
line6 there
So at least for the #show command the text is not appened unless you tell it to. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 11, 2006 7:27 pm |
Yep, that's the way it works in CMUD. If you have complicated aliases like this, then you should really be putting the specific %params (or %-1) reference into the lines that need it rather than using the auto append option. CMUD handles auto append by keeping track of the last parameter that has been referenced so far. It doesn't scan the script for %1 like zMUD did (zMUD did a text scan for %nnn to determine what the last "used" parameter is...CMUD does this at execution time so it doesn't see %1 until you actually use it).
The auto append option is only intended for those really simple aliases like:
#alias k {kill}
it is not intended for anything more complicated than this. |
|
|
|
|
|