its ugly as hell, and I'm sure the code could be cleaned up, but it works..
Code: Select all
|** atk.mac Auto-Attack Macro for everyday use.
Mashed together from other assorted macros.
has the ability to toggle taunting, and autofollowing
for those situations wher you jusnt might not want ta
follow that mob.
NOTE: I play a ranger, and use this during
every group in one form or another.
NOTE: I've remaped hotkey 10 to also be activated using Num_6
Then I put the archery ability in hotkey 10, which is how the auto archery
works. That way when I'm using autoarch, I can still chat.
NEW Version 1.0a
Usage:
/macro atk.mac arch (to enable Rapid Fire Archery
[forages too, take that code out if it annoys ya])
/macro atk.mac forage (auto forages, even while attacking)
/macro atk.mac forage taunt (forages and taunts)
/macro atk.mac follow taunt (to follow and taunt)
/macro atk.mac follow (to just follow)
/macro atk.mac taunt (to just taunt)
/macro atk.mac (to neither taunt nor follow)
NOTE: Auto-Following works, but sux,
use at yer own risk**|
#Event exp "experience!"
#Event Casting "You begin casting"
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
Sub Main(FirstArg,SecondArg)
/echo "Auto-Attack Macro has begun."
/declare Toggle local
/declare Toggle2 local
/declare startexp global
/declare startaaxp global
/declare EnrageVar global
/declare Combatstatus global
/declare currentxp global
/declare xpgain global
/declare currentaa global
/declare aagain global
/declare taunttoggle global
/declare followtoggle global
/declare foragetoggle global
/declare archtoggle global
/declare targetarray array
/varset Toggle @FirstArg
/varset Toggle2 @SecondArg
/varset startexp $char(exp)
/varset startaaxp $char(aa,exp)
/if "@Toggle"=="Follow" {
/echo "Auto-Follow enabled"
/varset "followtoggle" 1
}
/if "@Toggle2"=="taunt" {
/echo "Auto-Taunt enabled"
/varset "taunttoggle" 1
}
/if "@Toggle"=="taunt" {
/echo "Auto-Taunt enabled"
/varset "taunttoggle" 1
}
/if "@Toggle"=="forage" {
/echo "Auto-Forage enabled"
/varset "foragetoggle" 1
}
/if "@Toggle"=="arch" {
/echo "Auto-Arch enabled"
/varset "archtoggle" 1
}
:mainloop
/if "$combat"=="TRUE" /call melee
/delay 3
/if "@foragetoggle"==1 {
/if n $char(ability,"Forage")>0 /doability "Forage"
}
/doevents
/goto :mainloop
/return
Sub melee
/varset targetarray(0) "$target(name,clean)"
/varset targetarray(1) $target(level)
/varset targetarray(2) $target(name)
/varset targetarray(3) $target(id)
/delay 3
/if "@targetarray(3)"=="0" /return
:archcheck
/if "@archtoggle"==1 {
/attack off
/press num_6
/if "$target(id)"!=@targetarray(3) /goto :EndAF
/doevents
/if "@foragetoggle"==1 {
/if n $char(ability,"Forage")>0 /doability "Forage"
}
/goto :archcheck
}
/if "$combat"!="TRUE" /return
| /if n $target(distance,nopredict)>10 /return
/echo Fighting a level @targetarray(1) @targetarray(0)
/face nopredict
/varset Combatstatus 1
:CloserAF
/if "$target(id)"!=@targetarray(3) /goto :EndAF
/doevents
/call Combatcheck
/if "@followtoggle"==1 /call AF
/doevents
/if n $target(distance,nopredict)<11 {
/if n $char(ability,"Kick")>0 /doability "Kick"
}
/doevents
/if n $target(distance,nopredict)<11 {
/if n $char(ability,"Disarm")>0 /doability "Disarm"
}
/doevents
/if "@foragetoggle"==1 {
/if n $char(ability,"Forage")>0 {
/attack off
/doability "Forage"
/attack on
}
}
/if "@taunttoggle"==1 /doability taunt
/delay 4
/goto :CloserAF
/return
:EndAF
/echo The level @targetarray(1) @targetarray(0) is dead...
/sendkey up up
/sendkey up down
/attack off
/varset Combatstatus 0
/varset targetarray(3) 0
/press Num_5
/delay 4
/return
Sub AF
/if n $target(distance,nopredict)>25 /sendkey down up
/if n $target(distance,nopredict)>10 {
/if n $target(distance,nopredict)<25 {
/press Num_9
/delay 3
/sendkey down up
/press Num_9
}
}
/if n $target(distance,nopredict)<10 /sendkey up up
/face fast nopredict
/return
Sub Combatcheck
/if @EnrageVar=="1" {
/if $target()=="TRUE" {
/return
} else {
/varset EnrageVar 0
/varset Combatstatus 0
}
}
/if $target()=="FALSE" {
/varset Combatstatus 0
/if $combat=="TRUE" {
/attack off
}
/return
}
/return
Sub Event_Enraged
/if $target()=="TRUE" {
/if n @Combatstatus==1 {
/varset EnrageVar 1
/attack off
}
/varset EnrageVar 1
}
/return
Sub Event_Offrage
/if $target()=="TRUE" {
/if n @Combatstatus==1 {
/varset EnrageVar 0
/attack
}
/varset EnrageVar 0
}
/return
Sub Event_exp
/varset currentxp $char(exp)
/varcalc xpgain @currentxp-@startexp
/varset currentaa $char(aa,exp)
/varcalc aagain @currentaa-@startaaxp
/echo "You've gained @xpgain% xp and @aagain% aaxp."
/echo "Currently at @currentxp% xp and @currentaa% aaxp."
/varset startexp $char(exp)
/varset startaaxp $char(aa,exp)
/return
Sub Casting
:check
/delay 3
/if "$char(casting)"=="TRUE" goto :check
/return
