I've been working on a little helper script that re-arms weapon special abilities and a couple of other skills that I use.
A few people have been asking for something like this so I thought I might share.
It was designed to be as minimalistic as possible.
Currently it uses Primary, Secondary, Counter Attack, Momentum Strike, and Chivalry spells Consecrate Weapon and Divine Fury.
[P] [S] [C] [M] [V]
It works by doing a pixel colour match on the skill icons, so you need to set up the ability icons and then not move them.
If you do move them by a pixel or two, the top mini button on the right will restore the pixel colour.
If you move the icon by more than a few pixels, the bottom mini button will re do the setup procedure (which should start the first time it is run)
Subsequent runs don't require the setup to run.
Chivalry:
when [V] is activated, it casts consecrate weapon every 10 seconds, and also casts Divine Fury when your stamina drops below 50% (50% is configurable at the top of the script)
Known issues:
If one of your skills is active when the script runs it will get the wrong pixel colour for the skill and not work correctly.
(similarly if you do the setup with a skill active)
to fix: wait for skill to be inactive and click top mini button to reinitialise.
if you click the wrong skills during the setup, it wont detect when the skill is active
to fix: click the bottom mini button to re do the setup.
if you don't have high enough mana that 30% is enough to cast the spells, it will try enable it over and over.
to fix: tweak the percent at the top of the script (or get more mana)
Thanks to everyone who answered my questions on [c
Let me know how it goes for you.
edit:
version 1.1 - fixed bug where was using counter attack regardless of whether it was turned on
version 1.2 - fixed bug where turning off Primary arming, then enabling Counter was still turning primary on.
version 1.3 - added Chivalry spells, removed Death Strike (maxed now

Code: Select all
;--------------------------------------------------------------
; Nunja Armer |
; Re-arms weapon skills whenever they are used. |
; version 1.3 |
; 12th Sep 2011 |
;---------------------------------------------------------------
;http://wiki.easyuo.com/index.php/Event_Macro
set %sleepytime 20 ;
set %min_weap_mana_perc 30 ;script will not activate skill if mana below 30%
set %min_chiv_mana_perc 20 ;script will not activate skill if mana below 30%
set %min_stam_perc 50 ; below this will cast divine fury
set %consecrate_time 10 ; 10sec between conc
;---------------------------------------------------------------
; don't edit past here unless you know what you are doing |
;---------------------------------------------------------------
set %mode 0
set %use_counter #false
set %use_chiv #false
set %last_conc 0
if *PrimaryIconX = 0
{
gosub DoSetup
}
gosub DoInit
stateOFF:
set #menubutton null
gosub showMenu
while ( #true )
{
gosub HandleButtons
wait %sleepytime
}
stateON:
set #menubutton null
gosub showMenu
while ( #true )
{
gosub HandleButtons
if ( %mode <> 0 )
{
if ( ( #mana * 100 ) / #maxmana > %min_weap_mana_perc ) ;can change to: if ( #mana > 22 )
{
savePix %iconX %iconY 1
if ( #pixcol = %colour_test )
{
;it is not active... turn it on
event macro %event_macro_param1 %event_macro_param2
}
}
}
if ( ( #mana * 100 ) / #maxmana > %min_weap_mana_perc ) && ( H notin #charstatus ) && %use_counter
{
savePix *CounterIconX *CounterIconY 1
if ( #pixcol = %CounterColour )
{
;it is not active... turn it on
event macro 15 148 ;counter strike
}
}
if ( ( #mana * 100 ) / #maxmana > %min_chiv_mana_perc ) && ( H notin #charstatus ) && %use_chiv
{
if ( #time > ( %last_conc + %consecrate_time ) )
{
set %last_conc #time
event macro 15 203
}
if ( ( ( #stamina * 100 ) / #maxstam ) < %min_stam_perc ) && ( #time > %last_conc )
{
event macro 15 205
}
}
wait %sleepytime
}
SetStopped:
set %mode 0
set %use_counter #false
set %use_chiv #false
goto stateOFF
SetPrimary:
set %mode 1
set %iconX *PrimaryIconX
set %iconY *PrimaryIconY
set %colour_test %PrimaryColour
set %event_macro_param1 35
set %event_macro_param2 0
goto stateON
SetSecondary:
set %mode 2
set %iconX *SecondaryIconX
set %iconY *SecondaryIconY
set %colour_test %SecondaryColour
set %event_macro_param1 36
set %event_macro_param2 0
goto stateON
SetMomentum:
set %mode 3
set %iconX *MomentumIconX
set %iconY *MomentumIconY
set %colour_test %MomentumColour
set %event_macro_param1 15
set %event_macro_param2 150
goto stateON
SetChiv:
if %use_chiv
{
set %use_chiv #false
if %mode = 0
{
goto stateOFF
}
}
else
{
set %use_chiv #true
}
set %last_conc ( #time - %consecrate_time )
goto stateON
SetCounter:
if %use_counter
{
set %use_counter #false
if %mode = 0
{
goto stateOFF
}
}
else
{
set %use_counter #true
}
goto stateON
;--------------------------------------------------------------
; subs |
;--------------------------------------------------------------
sub ShowMenu
menu Clear
menu Window Size 120 60
menu window title Nunja Armer
menu Font Size 11
menu Show
gosub SetupMenuForNonActive
if %mode = 1
{
gosub SetupMenuForActive
menu Button primarybutton 4 4 20 20 P
gosub SetupMenuForNonActive
}
else
{
menu Button primarybutton 4 4 20 20 P
}
if %mode = 2
{
gosub SetupMenuForActive
menu Button secondarybutton 28 4 20 20 S
gosub SetupMenuForNonActive
}
else
{
menu Button secondarybutton 28 4 20 20 S
}
if %mode = 3
{
gosub SetupMenuForActive
menu Button momentumbutton 76 4 20 20 M
gosub SetupMenuForNonActive
}
else
{
menu Button momentumbutton 76 4 20 20 M
}
if %use_counter
{
gosub SetupMenuForActive
menu Button counterbutton 52 4 20 20 C
gosub SetupMenuForNonActive
}
else
{
menu Button counterbutton 52 4 20 20 C
}
if %use_chiv
{
gosub SetupMenuForActive
menu Button chivbutton 100 4 20 20 V
gosub SetupMenuForNonActive
}
else
{
menu Button chivbutton 100 4 20 20 V
}
if ( %mode > 0 ) || %use_counter || %use_chiv
{
menu Button stopbutton 16 28 92 30 [ STOP ]
}
menu Button initbutton 112 32 10 10
menu Button setupbutton 112 46 10 10
return
sub SetupMenuForActive
menu Window Color red
menu Font BGColor red
menu Font Color $02CFFD
return
sub SetupMenuForNonActive
menu Window Color black
menu Font BGColor black
menu Font Color $02CFFD
return
sub HandleButtons
if ( #menubutton = stopbutton )
goto SetStopped
if ( #menubutton = primarybutton )
goto SetPrimary
if ( #menubutton = secondarybutton )
goto SetSecondary
if ( #menubutton = counterbutton )
goto SetCounter
if ( #menubutton = momentumbutton )
goto SetMomentum
if ( #menubutton = chivbutton )
goto SetChiv
if ( #menubutton = initbutton )
gosub DoInit
if ( #menubutton = setupbutton )
{
gosub DoSetup
gosub DoInit
}
return
sub DoSetup
set #menubutton null
;primary
wait 10
event macro 8 1
while #CONTNAME <> paperdoll_gump
{
sleep 10
}
DISPLAY OK Please left click your Primary weapon ability icon. It must be inactive. $
set %posing #true
while %posing
{
while #contname <> abilityicon_gump
{
sleep 10
}
set %lIconX #CONTPOSX
set %lIconY #CONTPOSY
wait 10
if #CONTPOSX = %lIconX && #CONTPOSY = %lIconY
set %posing #false
}
set *PrimaryIconX %lIconX + 20
set *PrimaryIconY %lIconY + 20
;secondary
wait 10
event macro 8 1
while #CONTNAME <> paperdoll_gump
{
sleep 10
}
DISPLAY OK Please left click your Secondary weapon ability icon. It must be inactive. $
set %posing #true
while %posing
{
while #contname <> abilityicon_gump
{
sleep 10
}
set %lIconX #CONTPOSX
set %lIconY #CONTPOSY
wait 10
if #CONTPOSX = %lIconX && #CONTPOSY = %lIconY
set %posing #false
}
set *SecondaryIconX %lIconX + 20
set *SecondaryIconY %lIconY + 20
;counter
wait 10
event macro 8 1
while #CONTNAME <> paperdoll_gump
{
sleep 10
}
DISPLAY OK Please left click your Counter Attack icon. It must be inactive. $
set %posing #true
while %posing
{
while #contname <> spellicon_gump
{
sleep 10
}
set %lIconX #CONTPOSX
set %lIconY #CONTPOSY
wait 10
if #CONTPOSX = %lIconX && #CONTPOSY = %lIconY
set %posing #false
}
set *CounterIconX %lIconX + 20
set *CounterIconY %lIconY + 20
;momentum
wait 10
event macro 8 1
while #CONTNAME <> paperdoll_gump
{
sleep 10
}
DISPLAY OK Please left click your Momentum Strike icon. It must be inactive. $
set %posing #true
while %posing
{
while #contname <> spellicon_gump
{
sleep 10
}
set %lIconX #CONTPOSX
set %lIconY #CONTPOSY
wait 10
if #CONTPOSX = %lIconX && #CONTPOSY = %lIconY
set %posing #false
}
set *MomentumIconX %lIconX + 20
set *MomentumIconY %lIconY + 20
return
sub DoInit
set #menubutton null
savepix *PrimaryIconX *PrimaryIconY 1
set %PrimaryColour #pixcol
savepix *SecondaryIconX *SecondaryIconY 1
set %SecondaryColour #pixcol
savepix *CounterIconX *CounterIconY 1
set %CounterColour #pixcol
savepix *MomentumIconX *MomentumIconY 1
set %MomentumColour #pixcol
return