 |
vortis Novice
Joined: 15 Jul 2010 Posts: 39 Location: USA
|
Posted: Fri Jan 14, 2011 9:25 pm
#Alarm Assistance for a newbie |
I used to use #WAIT like it was going out of style when I first started using zMUD, I am now on CMUD 3.33a and am trying to correct the numerous...errors of my ways.
I learned about the #ALARM command after browsing around the help files and forum, but I seem rather inept at making one work the way I want it to.
Let me show you what I was doing before, hopefully it will make sense as to my end goal...
Here is a toggle button I made that I am trying to properly rennovate:
AA=1
#WHILE @AA=1 {
unwield @RWeapon
unwield @LWeapon
bodyslam @Target
emote hurls @Target into the ground splattering blood everywhere!
wield @RWeapon in right hand
wield @LWeapon in left hand
do hp,body
#WAIT 4000
}
BUTTON STATE 1:
AA=0
The idea was that every other round of combat my character unwields his weapons, bodyslams the target, re-wields his weapons and repeats until I click the button again which sets the @AA variable back to 0 and the loop stops.
How do I properly accomplish this within CMUD that won't cause CMUD crashes and generally unhappy events? |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4797 Location: Pensacola, FL, USA
|
Posted: Fri Jan 14, 2011 10:16 pm |
| Code: |
#ALARM "BodySlammer" -4 {
unwield @RWeapon
unwield @LWeapon
bodyslam @Target
emote hurls @Target into the ground splattering blood everywhere!
wield @RWeapon in right hand
wield @LWeapon in left hand
do hp,body
} |
Then the button only needs to be a simple push trigger with the following value
| Code: |
#IF (%trigger(BodySlammer)) {
#T- BodySlammer
#SAY no longer Bodyslamming
} {
#T+ BodySlammer
#SAY Slamming time!
} |
Also, you need to have something that can catch when combat ends, so you dont keep spamming the commands if you forget to toggle it manually |
|
|
|
 |
vortis Novice
Joined: 15 Jul 2010 Posts: 39 Location: USA
|
Posted: Fri Jan 14, 2011 10:48 pm |
That works great, but I found I don't even utilize half of the second piece of code you wrote. Perhaps I put the code in wrong, but here is the XML of the button I created.
This code is slightly modified for a different character, but same basic idea. Throw a lightning bolt every 4 seconds. I also added a 'bolt' to the first button code before the alarm so there is an instant attack rather than a 4 second delay before the first attack commences.
Here is the Button in plain text:
AutoBolt Toggle button:
bolt
#SAY "AutoBolt Enabled"
#ALARM "AutoBolt" -4 {
bolt
emote hurls a HUGE %^CYAN%^Lightning Bolt%^RESET%^ into the ground splattering blood everywhere!
hp
}
AutoBolt button state 1:
#IF (%class(AutoBolt)) {
#T- AutoBolt
#SAY AutoBolt Disabled
}
and here is the XML:
<button type="Toggle" color="yellow" priority="2221" id="73">
<caption>AutoBolt</caption>
<value>bolt
#ALARM "AutoBolt" -4 {
bolt
emote hurls a HUGE %^CYAN%^Lightning Bolt%^RESET%^ into the ground splattering blood everywhere!
hp
}</value>
<button color="lime" border="red" id="74">
<caption>AutoBolt</caption>
<value>#IF (%class(AutoBolt)) {
#T- AutoBolt
#SAY AutoBolt Disabled
}</value>
</button>
</button>
Am I doing this right? It appears to be working...
I get the feeling that you had a different intention in mind for the first code snippet rather than being inside the actual button and using the button to turn on and off the alarm? Is that possible also? I didn't see a class location for building alarms that could be #T+/#T- turned on and off by a toggle button... |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4797 Location: Pensacola, FL, USA
|
Posted: Sat Jan 15, 2011 12:29 am |
First off, yes, the alarm should be entered on the command line, not stuck into the button
Second, the button should be of type 'push', the #IF acts as the toggle.
The second half of the #IF statement is to turn the alarm back on since your not just recreating it with the button. |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Jan 15, 2011 12:33 am |
He did mean that code to be the entire code activated by the button. #T+ and #T- will work on any trigger, button, class, alarm, etc. that has a name. In this case, he named the alarm BodySlammer, and set the button to enable and disable that alarm.
|
|
|
|
 |
|
|
|