Code: Select all
| WariorBot.Mac
| v.1.1
| CHANGELOG
| v.1.0 - Initial Post
| v.1.1 - Updated Taunt to use HoTT
| Also Updated the macro to give the option to use advpath stuff or not.
| Changed the Combat loop to only do 1 /if statement for taunt stuff. Call me paranoid, but If this ever gets complex. I dont want it eating CPU cycles.
| Updated some shitty formatting. Should be a little easier to read and more uniform.
| v.1.2 - Put placeholder in for gotoanchor.
| Added toggle IsMA. If you have this set to true, you will taunt all mobs BEFORE attacking. You will fail up to 3 times before saying screw it and attacking anyways. This is usefull if you are the MA and need to taunt mobs before breaking mezz. If the mob in question becomes unmezzed, just hit your attack hotkey again and it will break out of the taunting loop and just attack normaly.
| WISHLIST - Anything to speed this up. Any small changes you can see to make it to less /if checks or less redundant code please post. I want this to be as clean as possible.
| Setup to use INI file rather than seting variables inside the macro.
| Find a better way to do backup, left, and right possitioning code. This way sucks ass.
#turbo 40
#include advpath.inc
#event AttackOn "#*#warriorbot assist on #1#"
#event AttackOff "#*#warriorbot assist off#*#"
#event FollowMe "#*#warriorbot follow on#*#"
#event SetAnchor "#*#warriorbotset anchor#*#"
#event ToggleTaunt "#*#warriorbot toggle taunt#*#"
#event ToggleBehind "#*#warriorbot toggle behind#*#"
#event ToggleMA "#*#warriorbot toggle MA#*#"
#event BackUp "#*#warriorbot backup#*#"
#event Left "#*#warriorbot left#*#"
#event Right "#*#warriorbot right#*#"
#event StickDistanceUp "#*#warriorbot stick distance up#*#"
#event StickDistanceDown "#*#warriorbot stick distance down#*#"
#event TauntCheck "#*#to ignore others and attack you#*#"
#event FailedTaunt "#*#You have failed to taunt your target#*#"
Sub Main
/call InitVars
:MainLoop
/if (${UseAdvPath}) /call AdvPathPoll
/if (${Agro}) /call Combat
/doevents
/goto :Mainloop
/return
Sub InitVars
|######### CHANGE THIS SHIT! ##################
/declare Master string outer ChangeMe
/declare UseAdvPath int outer 0
/declare TauntDisc string outer Incite
/declare FollowDistance int outer 5
|##############################################
/if (${UseAdvPath}) /call InitAPFVars 1 15 20
/declare CurMobID int outer 0
/declare Agro int outer 0
/declare AnchorLocX int outer 0
/declare AnchorLocY int outer 0
/declare InciteTimer timer outer 35
/declare Anchor int outer 0
/declare StickDistance int outer 13
/declare Taunt int outer 1
/declare Behind int outer 0
/declare Follow int outer 0
/declare IsMA int outer 0
/declare TauntSuccess int outer 0
/declare TauntTimer int outer 0
/declare FailedTaunt int outer 0
/declare InMAStuff int outer 0
/declare Breakout int outer 0
/return
Sub Combat
/target ID ${CurMobID}
/i say Attacking ${Target.CleanName}
/if (${Behind}) {
/stick on ${StickDistance} behind
} ELSE {
/stick on ${StickDistance}
}
/if (${IsMA}) /call DoMAStuff
/varset InMAStuff 0
/if (${Agro}) {
/attack on
} ELSE {
/return
}
:CombatLoop
/if ((${Target.Distance}<25)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
/if ((${Target.Distance}<25)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"
/if (${Taunt}) {
/if ( ${Target.Distance}<25 && !${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt"
/if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30) {
/disc ${TauntDisc}
/varset InciteTimer 35s
}
}
/doevents
/if (${Target.ID}!=${CurMobID}) {
/varset Agro 0
/varset CurMobID 0
}
/if (${Agro}) /goto :CombatLoop
/if (${Anchor}) /call GoHome
/if (${Follow}) {
/varset Follow 0
/call Event_FollowMe
}
/return
Sub Event_AttackOn(string line, int AssistOnID)
/if (${InMAStuff}) {
/varset Breakout 1
/i say Breakout of Taunt shit.
}
/if (${CurMobID}>0) {
/i say SWITCHING MOBS!
/attack off
/stick off
/target ID ${AssistOnID}
/if (${Behind}) {
/stick on ${StickDistance} behind
} ELSE {
/stick on ${StickDistance}
}
/attack on
}
/varset CurMobID ${AssistOnID}
/varset Agro 1
/return
Sub Event_AttackOff
/attack off
/stick off
/varset CurMobID 0
/varset Agro 0
/target ${Master}
/return
Sub Event_FollowMe
/if (!${Follow}) {
/i say Following You ${Master}
/if (${UseAdvPath}) {
/call FollowFunction "${Master}"
} ELSE {
/target ${Master}
/stick on ${FollowDistance}
}
/varset Anchor 0
/varset Follow 1
} ELSE {
/i say Not following you ${Master}
/if (${UseAdvPath}) {
/call StopFunction
} ELSE {
/stick off
}
/varset Follow 0
}
/return
Sub GoHome
/if (${UseAdvPath}) {
/call GotoFunction ${AnchorLocY} ${AnchorLocX}
} ELSE {
/call GotoFunction ${AnchorLocY} ${AnchorLocX}
/echo Placeholder for when I get rid of advpath.
}
/return
Sub Event_SetAnchor
/if (${Anchor}) {
/varset Anchor 0
/i say Anchor Off
} ELSE {
/varset AnchorLocX ${Me.X}
/varset AnchorLocY ${Me.Y}
/varset Anchor 1
/i say Anchor set at ${Me.X} ${Me.Y}
}
/return
Sub Event_StopAnchor
/varset Anchor 0
/i say Anchor Pulled
/return
Sub Event_ToggleTaunt
/if (${Taunt}) {
/varset Taunt 0
/i say No Longer Taunting Attackers Master
} ELSE {
/varset Taunt 1
/i say Taunting Attackers Master
}
/return
Sub Event_ToggleBehind
/if (${Behind}) {
/varset Behind 0
/i say Backstabbing mode off!
} ELSE {
/varset Behind 1
/i say Backstabbing mode on!
}
/return
Sub Event_BackUp
/keypress back hold
/delay .5s
/keypress back
/return
Sub Event_Left
/keypress strafe_left hold
/delay .7s
/keypress strafe_left
/return
Sub Event_Right
/keypress strafe_right hold
/delay .7s
/keypress strafe_right
/return
Sub Event_StickDistanceUp
/varcalc StickDistance (${StickDistance}+1)
/i say Stick Distance is now ${StickDistance}
/return
Sub Event_StickDistanceDown
/varcalc StickDistance (${StickDistance}-1)
/i say Stick Distance is now ${StickDistance}
/return
Sub Event_ToggleMA
/if (${IsMA}) {
/varset IsMA 0
/i say I am not the MA!
} ELSE {
/varset IsMA 1
/i say I am the MA!
}
/return
Sub DoMaStuff
/varset TauntSuccess 0
/varset InMAStuff 1
:Loop2
/doevents
/if (${Breakout}) {
/varset Breakout 0
/return
}
/if (${Target.ID}!=${CurMobID}) /return
/if (${Taunt}) {
/if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30) {
/disc ${TauntDisc}
/varset InciteTimer 35s
}
/if ( ${Target.Distance}<15 && ${Me.AbilityReady["Taunt"]}) {
/doability "Taunt"
}
/if (${TauntSuccess}) {
/return
}
/goto :Loop2
} ELSE {
/return
}
/return
Sub Event_TauntCheck
/if (!${InMAStuff}) /return
/echo Checking to see if taunt worked!
/varset TauntSuccess 0
/varset FailedTaunt 0
/delay 2s
/doevents
/if (${FailedTaunt}) {
/echo I failed taunt!
/varcalc TauntTimer ${TauntTimer}+1
/if (${TauntTimer}>2) {
/varset TauntTimer 0
/varset TauntSuccess 1
/echo I failed taunt twice. Screw it!
/return
}
} ELSE {
/varset TauntSuccess 1
}
/return
Sub Event_FailedTaunt
/if (!${InMAStuff}) /return
/varset FailedTaunt 1
/return
PS. Most commands are toggles. So one hotkey will turn it on/off.
PPS. If anybody out there has additions / bugfixed / things done better. Please share. I'll update main post.
PPPS. If I ever get arround to plugin programming I want to have the hotkeys in their own little makeshift pet window.
Oh and, you need mq2moveutils compiled. And Advpath.inc in your macro directory.


