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


Joined: 25 Feb 2004
Posts: 98

PostPosted: Wed Oct 05, 2011 12:30 pm   

Toggle Button To Control a Class issues
 
Hey All,

Even though I have been a huge CMud and ZMud user for years, I never have created a button until now.

Everything seems to work just fine if I use a variable as the control of the Button State, but if I try to use an expression like %class(GagClass) = 1, and then #CLASS GagClass 1 for state 0, and #CLASS GagClass 0 for state 1, it doesn't seem to work. I am just not sure how the expression option for toggle Buttons work, and haven't been able to figure it out through either experimentation or the documentation.

Thanks for the assistance!
Reply with quote
Stowslee
Wanderer


Joined: 20 Apr 2008
Posts: 69
Location: Watervliet, NY

PostPosted: Wed Oct 05, 2011 10:29 pm   
 
I would look into either the #CLASS command or the #T+ or #T- command. Below is an example of a script I use to handle turning on/off classes using a button.


Code:
<button type="Toggle" autosize="false" width="125" height="23" toolbar="4" priority="41620" id="4162">
  <caption>Auto-Bash Off</caption>
  <value>#T+ Auto-Bash</value>
  <button id="4163">
    <caption>Auto-Bash On</caption>
    <value>#T- Auto-Bash</value>
  </button>
</button>
Reply with quote
ins0mnia
Novice


Joined: 23 Jan 2011
Posts: 42
Location: United States

PostPosted: Thu Oct 06, 2011 12:07 am   
 
Just make your expression %class(GagClass), that will fix it

You don't strictly need to do this because the button will send the right command (Press 'ON' and it will always enable, Press 'OFF' and it will always disable) like Stowslee does,
but this will set the button to the right state when you start your session
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