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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Celerra7
Novice


Joined: 28 Jan 2010
Posts: 34

PostPosted: Sun Jan 16, 2011 10:08 pm   

Changing a Multistate Button state using cmd line or script [SOLVED]
 
I am trying to activate a specific state within a multistate button using the #BU command. This works fine with toggle buttons: #BU <button_id> 0 or #BU <button_id> 1. These work fine to turn a button off or on that is a toggle button, but not when I try to use the same function on a multistate button: #BU <button_id> 3. I would have assumed this command would set the 3rd state of the button. The only information I get back is the button has not changed and is still in the current state (I have a #SA statement for each state when it is activated, so I am confident which state I have entered into).

Can anyone give me a suggestion on managing this issue and programmatically setting a state without using the mouse to click the button and selecting from the menu?

Thanks, and have a great day.
Celerra7
Cmud 3.33a, Win7


Last edited by Celerra7 on Mon Jan 17, 2011 9:54 pm; edited 1 time in total
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Jan 17, 2011 3:40 pm   
 
First, are you sure that there is a state 3 for the button? Remember that the states start numbering at 0.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jan 17, 2011 5:17 pm   
 
The best way to do this is to enter a Variable Name into the Button options and then set the variable to the desired state. When the variable changes, the button will change states and execute the script for the new state. If you manually change the button state with the mouse, the variable will also be set to the correct state number. Works better than the #BUTTON command.
Reply with quote
Celerra7
Novice


Joined: 28 Jan 2010
Posts: 34

PostPosted: Mon Jan 17, 2011 9:46 pm   Changing a Multistate Button state using cmd line or script - RESOLVED
 
Zugg,

Man, that works so great. I was using the Button Variable to read what the state of the button was - never thought to change the variable in order to set the state. That's so cool, and works exacly the way I want, since you cannot get to the Default (0) state of the button through clicking the button. Thank you very much for a perfect solution.

Celerra7
CMUD 3.33a, Win7
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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