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
bcglassman
Newbie


Joined: 13 Mar 2007
Posts: 5

PostPosted: Tue Mar 13, 2007 7:39 am   

how do I pass a value to a variable in an alias at the time of execution?
 
ok ...

I want to pass a value to the alias when I invoke it ... for example

I type .. cf critter and it spits out abjure cosmicfire critter


I created an alias called "cf" but I can't figure out how to pass the value to the alias. I've tried using $1 %1 @1 ... $0 %0 @0 ... etc

it's the most basic thing on earth ... and yet .. I can't find this ANYWHERE in the help files or on this forum .. or have I been taking crazy pills.

what is the global variable for values passed in the command line ???


Last edited by bcglassman on Tue Mar 13, 2007 7:57 am; edited 1 time in total
Reply with quote
bcglassman
Newbie


Joined: 13 Mar 2007
Posts: 5

PostPosted: Tue Mar 13, 2007 7:56 am   
 
just to be clear ... I know how to #VAR target %1 ... but that takes 2 lines of input before my spell gets cast ... one line to define my target and another line to cast the spell at the target.
Reply with quote
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Tue Mar 13, 2007 8:30 am   
 
Using %1 in an alias represents the first argument provided. %2,%3, etc. work the same way. %-1 will use the full argument provided. However, when arguments aren't used in the value of the alias, the alias basically performs as if it has %-1 tacked on at the end. So from what I can see from your post, all you need to do is:

Code:

#alias cf {abjure cosmicfire}


So after this alias is set up, hitting "cf critter" will send to the mud "abjure cosmicfire critter". Hope this helps.
_________________
*ribbit*
Reply with quote
bcglassman
Newbie


Joined: 13 Mar 2007
Posts: 5

PostPosted: Tue Mar 13, 2007 7:27 pm   
 
thank you Very Happy
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