Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: 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}}
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: 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.
Reply with quote
Rehcra
Novice


Joined: 10 Oct 2000
Posts: 43

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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}}
Reply with quote
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Sat Nov 15, 2003 8:51 am   
 
You're a genious lightbulb didn't even think of that. Thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net