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
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Mon Jun 21, 2004 11:04 pm   

Macro %1?
 
I have a macro that I want to use and I want to add a variable to it. I have it so it is sent to the command line... but when I input my macro the %1...is just that a %1 on the command line. How do I do a simple variable with a macro that would work like an #ALIAS. I could just make an #ALIAS....but can a macro do this sort of thing? I am no whiz at this but I just love it!
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Tue Jun 22, 2004 2:01 am   
 
Since a macro is a single keystroke (after hitting ctrl, alt, and/or shift), you can't set %1 like you can for an alias. In every other regard, you would write the code for the macro the same as you would the alias. So, wherever you'd use the %1, you need to set up a variable, and manipulate that variable by some other means.

I have a number of macros that use #IF and #FORALL and such, too. So, if you want the macro to work a little different in different situations, then you'll need to set up triggers and/or aliases to change the variables it uses.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Jun 22, 2004 2:37 am   
 
Macros have a 'chaining' option that would allow you to hit a combination of keys to chain commands together. It's not something I've done myself, as I haven't found a useful purpose for it yet, but perhaps you could look into that and ask for assistance with it.
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Tue Jun 22, 2004 3:11 pm   
 
Larkin,
Thank-you for responding. I do not understand why if you can get Zmud to send the macro to the command line that it will not read the %1 as a vsrisble?
Is there any way i can write a macro that will allow me to ... smile (at what I choose)and wave at {what I choose)
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Tue Jun 22, 2004 3:43 pm   
 
#VAR first_object {diving dragon}
#VAR second_object {my future}

#KEY F1 {smile @first_object;wave at @second_object} "" {append|nosend}

I'd think an alias would be the way to go, but it's not my script.

A macro will usually send to the mud immediately when the key-combo is struck. In order to use variables in a macro, the variables must be defined before the macro is started. You could use the #VAR command to define the variable or use the x=y syntax.

Using the '%1' syntax doesn't make sense in a macro...there is no way to define the variable and fire the macro with the same key-stroke(s). Well, there might be a way, but it would be of limited use.

An alias accepts arguments which are TYPED on the command line after the alias name and the %1,%2... syntax places those arguments where they belong after you hit the enter key and before sending to the mud.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 22, 2004 5:04 pm   
 
Macros, whether they send commands to the command line or directly to the MUD, take IMMEDIATE action. There is no opportunity to supply additional information for use as %1, %2, etc.

Since there is no opportunity to use %1 in a macro, Zugg didn't bother writing code that would never be needed for something that could never happen.
Reply with quote
Twigg
Wanderer


Joined: 22 May 2003
Posts: 60
Location: USA

PostPosted: Tue Jun 22, 2004 7:13 pm   
 
Lightbulb,
Now I understand...and at least that small part falls into place!
Thank-you
Reply with quote
Ryntrax
Wanderer


Joined: 15 Mar 2004
Posts: 55
Location: USA

PostPosted: Tue Jun 22, 2004 8:32 pm   
 
could you use a %pi LB?
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