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
unrealtor
Beginner


Joined: 23 May 2020
Posts: 19

PostPosted: Mon Apr 08, 2024 4:53 pm   

Set Button State with Code
 
I can't seem to find a way to basically set selected index to X on a multi-state button. I am wanting to create an alias to quickly set a few different buttons to specific state selections (ex: "ButtonA" to state 2 and "ButtonB" to state 1). Is this possible?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Tue Apr 09, 2024 12:49 pm   
 
If you set the ID field of the button you can do:

#STATE ID 2
_________________
Discord: Shalimarwildcat
Reply with quote
unrealtor
Beginner


Joined: 23 May 2020
Posts: 19

PostPosted: Tue Apr 09, 2024 2:27 pm   
 
I set the button id as "dd_id", its variable as "dd_val", and there are 3 button states. I manually set the dropdown to button state 1. When I run "#state dd_id 3;#show @dd_val", the text in the dropdown doesn't change and @dd_val still displays as 1.

Update:
As I was typing this, I tried just setting the variable of the button and that worked... "#var dd_val 3".

Thanks for the help.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Tue Apr 09, 2024 8:02 pm   
 
The button variable has nothing to do with the state, by default anyway.
So this is expected behavior.

Usually that is a display value, for gauges and what have you.

If you are wanting to reference the current state of a given setting, you would use:
#SHOW %state(ID)
_________________
Discord: Shalimarwildcat
Reply with quote
Dybala
Newbie


Joined: 05 Jul 2024
Posts: 1

PostPosted: Fri Jul 05, 2024 12:19 pm   Re: Set Button State with Code
 
unrealtor wrote:
I can't seem to find a way to basically set selected index to X on a multi-state button. I am wanting to create an alias to quickly set a few different buttons to specific state selections (ex: "ButtonA" to state 2 and "ButtonB" to state 1). Is this possible?

To set the selected index on a multi-state button, you can create an alias to quickly change specific buttons to desired states. For example, you can set 'ButtonA' to state 2 and 'ButtonB' to state 1. It should be achievable with the right scripting.
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