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
jtviper456
Novice


Joined: 17 Jan 2003
Posts: 37

PostPosted: Fri Sep 26, 2008 4:22 am   

Alias Update Toggle Button?
 
Is there any way to make a button update automatically after firing off an alias that changes variables?
_________________
telnet://mud.astrakan.hig.se:4080
Reply with quote
Dyron
Apprentice


Joined: 08 Apr 2004
Posts: 103
Location: USA

PostPosted: Fri Sep 26, 2008 4:39 am   
 
Hrmm.. need more details on what you mean
Reply with quote
jtviper456
Novice


Joined: 17 Jan 2003
Posts: 37

PostPosted: Fri Sep 26, 2008 4:52 am   
 
I've got a Toggle button...that toggles variable 1

So, I push the button down, Variable A is changed to the value 1...release the button, and Variable A is changed to 0....

I also have an alias that changes Variable A to 1, but the button state won't change when the alias changes the variable!
_________________
telnet://mud.astrakan.hig.se:4080
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Sep 26, 2008 3:45 pm   
 
The solution is to check if the button is already toggled, (in state 1) and then if it isn't use the #BUTTON [id] in the alias to make the alias "click" the button.

Example Code:
Code:
#CLASS {ButtonStateExample}
#ALIAS DoButton {#IF (@BtnState = 0) {#BUTTON StateTestBtn}}
#VAR BtnState {1}
#BUTTON 1 {Up} {#ECHO I've just Released My Toggled} {Down} {#ECHO I've just Engaged My Toggled} {} {BtnState} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {StateTestBtn}
#CLASS 0


Then when you do the alias, if the button is already "On" it ignores the alias, if it is "Off" it performs the button and thus sets the value to 1.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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