|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jun 02, 2008 10:12 pm
New option in 2.26 for not parsing alias arguments |
Based upon some other posts and feedback, it has come to my attention that some people would really prefer if the arguments to their aliases were not parsed (more like how zMUD worked). Even though it was easy to handle this using #ONINPUT triggers instead of aliases, I have added an option to Aliases called "Parse arguments". This option is Enabled by default.
If this option is disabled, then no parsing will be done for any arguments of an alias. Arguments will still be properly grouped into %1..%99 by spaces, and you'll still be able to put " quotes around text to force it to store multiple words into a single argument (but the " quotes will *not* be stripped). The only parsing that is done is that CMUD will still look for the ; command separator character. But it also uses "smiley detection" so it won't detect a ; within " quotes, or a ; that isn't followed by a alphabetic or # or . character.
Here is an example of an alias:
Code: |
#ALIAS test {
#LOOP %numparam {
#SHOW %i": " %param(%i)
}
#SHOW "all: " %params
} |
with the Parse Arguments option turned off in the settings editor (it is under the Auto Append option), here are some samples:
Code: |
test "hello world"
1: "hello world"
all: "hello world"
test CMUD is #1 ;)
1: CMUD
2: is
3: #1
4: ;)
all: CMUD is #1 ;) |
Hopefully this will make it easier to use CMUD aliases on M*s that use a lot of special characters, or to convert certain zMUD aliases that needed this feature without needing to use #ONINPUT.
If anyone sees any possible problem or side effect with this, let me know. |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Jun 02, 2008 10:57 pm |
Very nice! I have been mildly annoyed lately even just chatting and using parentheses in my speech. CMUD kept trying to evaluate what I was saying as though it was an expression, so I had to escape the characters every time...
|
|
|
|
kinnoinen Beginner
Joined: 30 Jan 2005 Posts: 26
|
Posted: Sun Jul 06, 2008 3:27 pm Re: New option in 2.26 for not parsing alias arguments |
What if the arguments have multiple spaces between them? Like if I want to make an alias:
#alias tz {tell zugg %params}
And I type:
tz word1 word2 <some white spaces here> word3
Then the result is:
tell zugg word1 word2 word3
I have tried to find a way to get around this problem but haven't found any. Any ideas?
EDIT: Seems even this forum is parsing multiple spaces. :D |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jul 07, 2008 8:00 pm |
HTML always eats multiple spaces. You have to post stuff within [CODE] tags to preserve spacing on the forums.
But I confirmed the bug with the Parse Arguments option not handling multiple spaces and have added that to the bug list.
The only workaround is to turn the Parse Arguments back on and put " quotes around your alias arguments, like this:
Code: |
tz "word1 word2 word3" |
|
|
|
|
|
|