|
SmilingReaper Newbie
Joined: 10 Jan 2002 Posts: 8
|
Posted: Fri Jan 11, 2002 3:00 pm
Button states |
I've added several toggle buttons for spells to the toolbar that I want to change to an untoggled state when the spell wears off. So, for the spell strength when the message You feel weaker is shown, I want the button to return to the unpressed state. I put the id of the button as bstrength, and then used a trigger for the message and had it #SET bstrength 1. I also tried but that didn't work. Is there a way to change the state of a toggle button with a trigger?
|
|
|
|
Palomar Apprentice
Joined: 11 Oct 2000 Posts: 138 Location: Portugal
|
Posted: Fri Jan 11, 2002 3:11 pm |
I think what you want is the #BUTTON command, check it out. The command #SET is for state triggers, a whole different game.
Palomar |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 11, 2002 5:13 pm |
Assuming you store the button's state in a variable, you can change the button's state by changing the variable from 0 (off) to 1 (on) or vice-versa. You could also assign and use the "value-expression" to toggle it if I understand the helpfile correctly.
There is no #SET command (in 6.16) but there is a #SETPROMPT command. It has nothing to do with buttons though, other than possibly altering the variables/expressions controlling them.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Jan 12, 2002 11:09 am |
Lightbulb is very right about the variable. The thing to note with this tactic is that it will automatically preform the buttons script when the variable is changed. This might be a bad thing depending on your mud and other triggers. If you wish to go this route you can set the variable for such buttons on the advanced tab of the button in the settings editor.
Personally I use push buttons with a caption such as:
Strength: %if(@AmStrengthed,On,Off)
That allows the buttons displayed name to update but the commands never change. In the case of the example you gave I don't really think your mud has a command to let you expire your strength spell and a toggle button isn't really what you would want. |
|
|
|
dskorren Novice
Joined: 07 Feb 2002 Posts: 48 Location: Philippines
|
Posted: Mon Mar 11, 2002 10:00 am |
#TRIGGER {^Spell: 'bless'} {#var sp01 1} "Affected"
#TRIGGER {^Spell: 'armor'} {#var sp02 1} "Affected"
#TRIGGER {^Spell: 'sanctuary'} {#var sp03 1} "Affected"
#TRIGGER {^Spell: 'pray'} {#var sp04 1} "Affected"
#TRIGGER {^Spell: 'fireshield'} {#var sp05 1} "Affected"
#TRIGGER {^Spell: 'aid'} {#var sp06 1} "Affected"
#TRIGGER {^Spell: 'iceshield'} {#var sp07 1} "Affected"
#TRIGGER {^Spell: 'golden aura'} {#var sp08 1} "Affected"
#TRIGGER {^Spell: 'displacement'} {#var sp09 1} "Affected"
#TRIGGER {^Spell: 'adrenaline control'} {#var sp10 1} "Affected"
#TRIGGER {^Spell: 'shield'} {#var sp11 1} "Affected"
#TRIGGER {^Spell: 'stone skin'} {#var sp12 1} "Affected"
#TRIGGER {^Spell: 'mental barrier'} {#var sp13 1} "Affected"
#TRIGGER {^Spell: 'holy strength'} {#var sp14 1} "Affected"
#TRIGGER {^Spell: 'haste'} {#var sp15 1} "Affected"
#TRIGGER {$} {#t- Affected;#t+ Spellup} "Affected"
#TRIGGER {You feel righteous} {#var sp01 1} "SpellUp"
#TRIGGER {You feel someone protecting you} {#var sp02 1} "SpellUp"
#TRIGGER {You are surrounded by a white aura} {#var sp03 1} "SpellUp"
#TRIGGER {Kells places a blessing on you} {#var sp04 1} "SpellUp"
#TRIGGER {Your body is engulfed by unfelt flame} {#var sp05 1} "SpellUp"
#TRIGGER {You feel divine aid reassure you} {#var sp06 1} "SpellUp"
#TRIGGER {An icy crust forms about your body} {#var sp07 1} "SpellUp"
#TRIGGER {You are surrounded by a golden aura} {#var sp08 1} "SpellUp"
#TRIGGER {Your form shimmers, and you appear displaced} {#var sp09 1} "SpellUp"
#TRIGGER {You gain control over your adrenaline} {#var sp10 1} "SpellUp"
#TRIGGER {You are surrounded by a force shield} {#var sp11 1} "SpellUp"
#TRIGGER {Your skin turns to stone} {#var sp12 1} "SpellUp"
#TRIGGER {You erect a mental barrier around} {#var sp13 1} "SpellUp"
#TRIGGER {The strength of the gods fills you} {#var sp14 1} "SpellUp"
#TRIGGER {You feel yourself moving more quickly} {#var sp15 1} "SpellUp"
#TRIGGER {You feel less righteous} {#var sp01 0} "SpellUp"
#TRIGGER {You feel less protected} {#var sp02 0} "SpellUp"
#TRIGGER {The white aura around your body fades} {#var sp03 0} "SpellUp"
#TRIGGER {The blessing of the immortals leaves your} {#var sp04 0} "SpellUp"
#TRIGGER {The flames engulfing your body burn out} {#var sp05 0} "SpellUp"
#TRIGGER {You feel divine aid dissipate} {#var sp06 0} "SpellUp"
#TRIGGER {The icy crust about your body melts away} {#var sp07 0} "SpellUp"
#TRIGGER {The golden aura around} {#var sp08 0} "SpellUp"
#TRIGGER {You are no longer displaced} {#var sp09 0} "SpellUp"
#TRIGGER {Your fine mental control of your adrenaline} {#var sp10 0} "SpellUp"
#TRIGGER {Your force shield shimmers then fades away} {#var sp11 0} "SpellUp"
#TRIGGER {Your skin feels soft again} {#var sp12 0} "SpellUp"
#TRIGGER {Your mental barrier breaks down} {#var sp13 0} "SpellUp"
#TRIGGER {Your divine strength fades} {#var sp14 0} "SpellUp"
#TRIGGER {You feel yourself slow down} {#var sp15 0} "SpellUp"
#KEY CTRL-[ {#t+ Affected;#t- SpellUp;#var sp01 0;#var sp02 0;#var sp03 0;#var sp04 0;#var sp05 0;#var sp06 0;#var sp07 0;#var sp08 0;#var sp09 0;#var sp10 0;#var sp11 0;#var sp12 0;#var sp13 0;#var sp14 0;#var sp15 0;affect}
#KEY CTRL-] {#t- SpellUp}
#BUTTON 1 {bless} {} {} {c bless} {@sp01 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 2 {armo} {} {} {c armor} {@sp02 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 3 {sanc} {} {} {c sanc} {@sp03 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 4 {pray} {} {} {} {@sp04 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 5 {fires} {} {} {c fires} {@sp05 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 6 {aid} {} {} {c aid} {@sp06 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 7 {ices} {} {} {c ices} {@sp07 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 8 {gold} {} {} {c gold} {@sp08 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 9 {gi} {} {} {} {@sp09 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 10 {gem} {} {} {} {@sp10 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 11 {shld} {} {} {} {@sp11 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 12 {ston} {} {} {} {@sp12 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 13 {barr} {} {} {} {@sp13 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 14 {hstr} {} {} {} {@sp14 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
#BUTTON 15 {haste} {} {} {} {@sp15 = 1} {1} {} {} {} {} {} {} {} {112} {127} {} {} "SpellUp" {} {} {}
**********************************************************************************************
i think that we basically have the same spell ups so the above might work for you.
when the spellup class is active it catches the spell up/spell down phrase and changes vars
accordingly, you can turn it off by presing ctrl+] (when your just lazing around and not
doing anything and dont want to waste your mana by the auto casting when a spell wears off.
the affected class is used to do a spell wipe, specially if you got disconnected. its to refresh
the buttons to reflect the current spell ups you want. the ctrl+[ is bugged since it waits for
a blank line and it can get triggered if anything arrives (like chat, ooc, auction) but at least
you only press it once :) just press it again.
some buttons have no commands like pray because it makes you unconscious, the others are invokes
and you might not be carrying it at the moment, so its just a place holder, the buttons with commands
contains the spells you can cast, it only get depressed when it is successfully casted, so you
can loose concentration all the time and it wont matter, just press till it succeeds.
the auto casting of spells because of changed vars is a hassle but does not affect the buttons
since the triggers set them up. so when your fighting and one spells wear off all you get is
the you cant concentrate enough msg. otherwise the button is still registering correctly.
http://www.geocities.com/nantax/zmud.jpg |
|
|
|
Ashen Beginner
Joined: 16 Apr 2001 Posts: 10 Location: USA
|
Posted: Tue Apr 02, 2002 11:01 am |
This is my trigger.
Pattern: The tower of mortal will around you fades.
Value: #BU IDtower
This basically toggles my "Tower of Strength" button to its "Off" state. |
|
|
|
|
|