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
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Thu May 02, 2002 4:57 pm   

Buttons and macros
 
Is there anyway to have a macro that will turn on a button?

Basically I have buttons (toggle state) already that will turn on classes. Basically, I want to just have a macro that will do the same but also change the state of the button itself so this way I don't have to use my mouse everytime to click on the button (on or off).

Upon pressing the macro (such as F5, F6 etc..) the button will change as well letting me know it's on.

Get it?

Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 02, 2002 5:52 pm   
 
Go to the Advanced tab in the Button editor. Assign a variable to the button. If you enter button1 in the variable field, you can then control the button by changing @button1. When @button1 = 0 the button will be toggled one way, when @button1 = 1 the button will be toggled the other way. A macro to do this would be:
#KEY F5 {#VAR button1 {%eval((@button1+1)2)}}

LightBulb
Vague questions get vague answers
Reply with quote
Sildaren
Wanderer


Joined: 19 Jul 2001
Posts: 59
Location: Germany

PostPosted: Thu May 02, 2002 6:04 pm   
 
Or you can shorten Lightbulbs solution a bit:
#KEY F5 {#MATH button1 {1-@button1}}
(same thing, just different math)

or you enter an ID for the button at it's option page (eg. 'but1' - yeah, my creativity is lacking) , and use
#BUTTON but1
inside the macro to toggle it.
(In the older zMUD versions that don't have the option to assign ID's you
can use the number of the button in the #BUTTON command.)
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