|
john_taylor_jr Wanderer
Joined: 17 Jan 2003 Posts: 57 Location: USA
|
Posted: Wed Nov 12, 2003 5:19 pm
two word alias |
on my mud I have a sneak command and I set up a button to sneak and not sneak
by using aliases this works fine on standard exits and any one word exit
what should I do about two word exits such as
move bookcase
#ALIAS n {#IF (@sneak = 1) {sneak n} {~n}} |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Wed Nov 12, 2003 5:38 pm |
ok, if you move bookcase, do you go in that direction or is a secret passage revealed? I mean, if it moves you through the bookcase, I don't see why #ALIAS mb {#IF @sneak {sneak move bookcase}} wouldn't work. You try that. I'm not sure what exactly what the {~n}} performs for the alias. I'm still gradually becoming familiar with ZMud and writing alias and triggers and such.
|
|
|
|
Rehcra Novice
Joined: 10 Oct 2000 Posts: 43
|
Posted: Wed Nov 12, 2003 6:39 pm |
For Dagnimaer:
The alias is 'n', if the second part of the #IF was just 'n', it would call this alias and be in an infinite loop (until ZMud complained). The tilde tells Zmud to not process the 'n' as an alias, but to send this command directly to the MUD. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Nov 12, 2003 8:21 pm |
It's possible to make two-word aliases but they don't work. Instead, just include a check of the first word in the alias's #IF routine.
#AL move {#IF (@sneak AND ("%1" = "bookcase")) {sneak move %-1} {~move %-1}} |
|
|
|
john_taylor_jr Wanderer
Joined: 17 Jan 2003 Posts: 57 Location: USA
|
Posted: Sat Nov 15, 2003 8:51 am |
You're a genious lightbulb didn't even think of that. Thanks!
|
|
|
|
|
|