Cleaned up some redundant code, especially in the initial varsets. Fixed all the variable names to match the IniFile keys to make this possible.
edit: blah, file too larget to post...
Code: Select all
|---------------------------------------------------------------------------------
|
| Rogue Helper (RH) Macro
| - v6.0 by Jerle (10/26/04)
|
| Documentation for RH is now separated from the macro proper. Please look for
| RHDocs.html for syntax and use, or RHChangeLog.txt for the implementation
| change log.
|
|---------------------------------------------------------------------------------
|
| RH Syntax:
|
| Usage: /mac rh
|
| Default settings can be changed by their respective controlling /command
|
| Type /rhhelp for help or /status to see current settings!
|
|---------------------------------------------------------------------------------
#Chat tell
#Event StrikeVic "#*#Seeking a Victim#*#"
#Event AttackOn "#*#Auto attack is on#*#"
#Event AttackOff "#*#Auto attack is off#*#"
#Event Enraged "#*#|${Target.CleanName}| has become ENRAGED#*#"
#Event NLEnraged "#*#|${Target.CleanName}| is no longer enraged#*#"
#Event TooFarAway "#*#Your target is too far away, get closer#*#"
#Event Exp "#*#You gain#*#experience#*#"
#Event Slain "#*# slain#*#"
#Event Zoned "#*#You have entered#*#"
#Event GotHit "#1#YOU for#*#points of damage."
#Event GotMissed "#1#to#*#YOU, but #*#"
#Event SpellBounced "#*#Your spell did not take hold#*#"
#Event SwitchWeapon "#*#|${SwitchText}|#*#"
#Event FTrap "#*#You sense a trap in this direction."
#Event BTrap "#*#You are certain that #*#"
#Event TogEvade "[MQ2] Autoevade#*#"
#Event TogPick "[MQ2] Autopick#*#"
#Event TogStick "[MQ2] Autostick#*#"
#Event TogHS "[MQ2] Auto Hide & Sneak#*#"
#Event TogLeash "[MQ2] Leash#*#"
#Event TogAuto "[MQ2] Autoassist#*#"
#Event TogDynamicAggro "[MQ2] DynamicAggro#*#"
#Event TogPause "[MQ2] Pause#*#"
#Event TogTSwitch "[MQ2] AutoTargetSwitch#*#"
#Event TogTraps "[MQ2] AutoTraps#*#"
#Event TogDynamicCloseness "[MQ2] DynamicCloseness#*#"
#Event LinkParse "[MQ2] LinkParse#*#"
#Event SetStopFighting "[MQ2] SetStopFighting#*#"
#Event SetEndFloor "[MQ2] SetEndFloor#*#"
#Event SetStrikeDisc "[MQ2] SetStrikeDisc#*#"
#Event SetCloseness "[MQ2] SetCloseness#*#"
#Event SetFirstAssist "[MQ2] SetMainAssist#*#"
#Event SetSecondAssist "[MQ2] SetSecondAssist#*#"
#Event SetThirdAssist "[MQ2] SetThirdAssist#*#"
#Event SetAutoNinja "[MQ2] SetAutoNinja#*#"
#Event SetWeaponSwitch "[MQ2] SetWeaponSwitch#*#"
#Event SetStickDist "[MQ2] SetStickDist#*#"
#Event SetChicken "[MQ2] SetChicken#*#"
#Event SetDisc1 "[MQ2] SetDisc1#*#"
#Event SetDisc2 "[MQ2] SetDisc2#*#"
#Event SetLeashFlex "[MQ2] SetLeashFlex#*#"
#Event SetVerbosity "[MQ2] SetVerbosity#*#"
#Event SetChannel "[MQ2] SetChannel#*#"
#Event DragBodies "[MQ2] DragBodies#*#"
#Event LootMyCorpse "[MQ2] LootMyCorpse#*#"
#Event AutoFollow "[MQ2] AutoFollow#*#"
#Event AddMaster "[MQ2] AddMaster#*#"
#Event RemMaster "[MQ2] RemoveMaster#*#"
#Event ItemSet "[MQ2] ItemSet#*#"
#Event ItemBounce "[MQ2] ItemBounce#*#"
#Event ItemCast "[MQ2] ItemCast#*#"
#Event HelpInfo "[MQ2] RH Help#*#"
#Event StatInfo "[MQ2] RH Status#*#"
Sub Main
/echo Loading Rogue Helper... Please Wait!
/declare AutoEvade bool outer TRUE
/declare StopFightingHealth int outer 30
/declare StrikeSkill string outer Assassin
/declare MinEndurance int outer 80
/declare isEnraged bool outer FALSE
/declare strikeReady bool outer FALSE
/declare strikeTimer timer outer 0
/declare LDExp float outer ${Me.PctGroupLeaderExp}
/declare AAExp float outer ${Me.PctAAExp}
/declare Exp float outer ${Me.PctExp}
/declare AutoStick bool outer TRUE
/declare X float outer
/declare Y float outer
/declare behindTarget bool outer FALSE
/declare i int outer
/declare dir int outer
/declare delta int outer
/declare strafedir string outer
/declare Closeness int outer 70
/declare AutoHideSneak bool outer TRUE
/declare Leashing bool outer FALSE
/declare LeashLength int outer 0
/declare stakeX int outer ${Me.X}
/declare stakeY int outer ${Me.Y}
/declare LeashHolder string outer Nobody
/declare AutoAssist bool outer FALSE
/declare MainAssist string outer Nobody
/declare FirstAssist string outer Nobody
/declare SecondAssist string outer Nobody
/declare ThirdAssist string outer Nobody
/declare AssistPercentage int outer 98
/declare oldtargetID int outer ${Target.ID}
/declare assisttimer timer outer 0
/declare doDynamicAggro bool outer FALSE
/declare gotHit bool outer FALSE
/declare aggrotimer timer outer 0
/declare ialias string outer None
/declare doIclick bool outer FALSE
/declare bouncenum int outer 1
/declare ibounce string outer None
/declare itemspellname string outer None
/declare clicktimer timer outer 0
/declare isPaused bool outer FALSE
/declare AutoNinjaMode string outer OFF
/declare AutoNinjaDistance int outer 50
/declare AutoPickPocket bool outer FALSE
/declare WeaponSwitching bool outer FALSE
/declare SwitchText string outer +Undefined+
/declare Weapon1 string outer None
/declare Weapon2 string outer None
/declare wstype string outer Detrimental
/declare TargetSwitching bool outer TRUE
/declare lastevent string outer None
/declare StickRangeToTarget int outer 200
/declare StickRangeToTank int outer 100
/declare useMU bool outer FALSE
/declare TrapNegotiation bool outer FALSE
/declare oldheading string outer Default
/declare AutoChicken bool outer FALSE
/declare NimbleHealth int outer 20
/declare ContingencyEscape bool outer FALSE
/declare nimbletimer timer outer 0
/declare nimbleactive timer outer 0
/declare chickentimer timer outer 0
/declare AutoDisc1 bool outer FALSE
/declare Disc1 string outer Deadly Precision
/declare Disc1Endurance int outer 60
/declare Disc1Reuse int outer 5
/declare Disc1Reusetimer timer outer 0
/declare AutoDisc2 bool outer FALSE
/declare Disc2 string outer Kinesthetics
/declare Disc2Endurance int outer 60
/declare Disc2Reuse int outer 5
/declare Disc2Reusetimer timer outer 0
/declare discactive timer outer 0
/declare LeashFlex int outer 10
/declare doDynamicCloseness bool outer TRUE
/declare Closenessdesired int outer 70
/declare acquiretimer timer outer 0
/declare snuggleup bool outer FALSE
/declare isTanking bool outer FALSE
/declare Verbosity int outer 2
/declare Channel string outer echo
/declare rhversion string outer 6.0
/declare INIFileName string outer RHSettings.ini
/goto :BypassVCheck
|- Check versions and load aliases if necessary
/if (${Ini[${INIFileName},General,Version].Equal[${rhversion}]}) /goto :EndAlias
:BypassVCheck
/if (${Verbosity}>=0) /${Channel} Setting Aliases...
/squelch /alias /status /echo RH Status
/squelch /alias /rhhelp /echo RH Help
/squelch /alias /autoevade /echo Autoevade
/squelch /alias /autopick /echo Autopick
/squelch /alias /stopfight /echo SetStopFighting
/squelch /alias /strikedisc /echo SetStrikeDisc
/squelch /alias /endfloor /echo SetEndFloor
/squelch /alias /autostick /echo Autostick
/squelch /alias /autohs /echo Auto Hide & Sneak
/squelch /alias /leash /echo Leash
/squelch /alias /autoassist /echo Autoassist
/squelch /alias /DynamicAggro /echo DynamicAggro
/squelch /alias /Closeness /echo SetCloseness
/squelch /alias /MainAssist /echo SetMainAssist
/squelch /alias /SecondAssist /echo SetSecondAssist
/squelch /alias /ThirdAssist /echo SetThirdAssist
/squelch /alias /drag /echo DragBodies
/squelch /alias /lootmycorpse /echo LootMyCorpse
/squelch /alias /autofollow /echo AutoFollow
/squelch /alias /iset /echo ItemSet
/squelch /alias /ibounce /echo ItemBounce
/squelch /alias /iclick /echo ItemCast
/squelch /alias /pause /echo Pause
/squelch /alias /autoninja /echo SetAutoNinja
/squelch /alias /addmaster /echo AddMaster
/squelch /alias /remmaster /echo RemoveMaster
/squelch /alias /weaponswitch /echo SetWeaponSwitch
/squelch /alias /targetswitch /echo AutoTargetSwitch
/squelch /alias /stickdist /echo SetStickDist
/squelch /alias /autotraps /echo AutoTraps
/squelch /alias /autochicken /echo SetChicken
/squelch /alias /autoDisc1 /echo SetDisc1
/squelch /alias /autoDisc2 /echo SetDisc2
/squelch /alias /LeashFlex /echo SetLeashFlex
/squelch /alias /Verbosity /echo SetVerbosity
/squelch /alias /Channel /echo SetChannel
/squelch /alias /DynamicCloseness /echo DynamicCloseness
/squelch /alias /lp /echo LinkParse
:EndAlias
|-- Update the Version information
/ini "${INIFileName}" "General" "Version" "${rhversion}"
|-- Read in INI settings, if defined... Leashing is only stored TRUE if there is a Leash-holding Master!
/declare IniValues string local AutoEvade StopFightingHealth StrikeSkill MinEndurance AutoStick Closeness AutoHideSneak Leashing LeashHolder LeashLength
/varset IniValues ${IniValues} LeashFlex AutoAssist AssistPercentage MainAssist SecondAssist ThirdAssist DynamicAggro AutoAutoNinjaMode AutoAutoNinjaDistanceance
/varset IniValues ${IniValues} AutoPickPocket WeaponSwitching TargetSwitching StickRangeToTarget StickRangeToTank TrapNegotiation AutoChicken NimbleHealth
/varset IniValues ${IniValues} ContingencyEscape AutoDisc1 Disc1 Disc1Endurance Disc1Reuse AutoDisc2 Disc2 Disc2Endurance Disc2Reuse DynamicCloseness Verbosity Channel
/for i 1 to ${Math.Calc[${IniValues.Count[" "]}+1]}
/if (${Ini[ ${INIFileName},General,${IniValues.Arg[${i}]}].NotEqual[NULL]}) /varset ${IniValues.Arg[${i}]} ${Ini[${INIFileName},General,${IniValues.Arg[${i}]}]}
/next i
/deletevar IniValues
| FirstAssist, the ugly duckling...
/if (${Ini[${INIFileName},General,MainAssist].NotEqual[NULL]}) /varset FirstAssist ${Ini[${INIFileName},General,MainAssist]}
/if (${Ini[${INIFileName},Weapons,Weapon1].NotEqual[NULL]}) /varset Weapon1 ${Ini[${INIFileName},Weapons,Weapon1]}
/if (${Ini[${INIFileName},Weapons,Weapon2].NotEqual[NULL]}) /varset Weapon2 ${Ini[${INIFileName},Weapons,Weapon2]}
/if (${Ini[${INIFileName},Weapons,SwitchText].NotEqual[NULL]}) /varset SwitchText ${Ini[${INIFileName},Weapons,SwitchText]}
/varset Closenessdesired ${Closeness}
/varset wstype ${FindItem[${Weapon1}].Spell.SpellType}
|- Build Empty master list in ${INIFileName} file if it doesn't exist
/if (!${Ini[${INIFileName},Masters,Controller1].Length}) {
|- It's not in there yet
/for i 1 to 20
/ini "${INIFileName}" "Masters" "Controller${i}" "Nobody"
/next i
}
/echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/echo Jerle's Rogue Helper Macro (v${rhversion}) Starting...
/echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/echo Use "/rhhelp" to display help information
/echo RH Status
:ForeverLoop
|- Service any events
/doevents
|- If we're stunned or RH is paused, just service events
/if (${Me.State.Equal[STUN]} || ${isPaused}) {
/delay 2
/goto :ForeverLoop
}
|- While fighting or not fighting...
|- Turn attacking back on if enraged target, and no longer facing it
/if (${isEnraged} && ${Target.ID} && ${AutoAssist} && !${Me.Combat}) {
/call Check_Behind
/varset behindTarget ${Macro.Return}
/if (${Target.ID} && ${behindTarget}) {
/attack on
/if (${Verbosity}>=1) /${Channel} ** Attack re-started (No Enrage Risk): ${Target.CleanName}
}
}
|- Check if we should chicken out
/if (${AutoChicken} && (${Me.PctHPs}<=${NimbleHealth}) && !${chickentimer}) {
/if (${Verbosity}>=1) /${Channel} Autochicken to the rescue!
/if (!${nimbletimer}) {
/disc nimble
/if (${Verbosity}>=1) /${Channel} Nimble mode activated!
/varset nimbletimer 21m
/varset nimbleactive 12s
} else /if (${Me.AltAbilityReady[Escape]} && !${nimbleactive}) {
/if (${Verbosity}>=1) /${Channel} Contingency Escape activated! (Nimble expired/unavailable)
/attack off
/alt activate 102
/varset chickentimer 30s
} else {
/if (${Verbosity}>=1) /${Channel} ... or not! Can't escape, can't nimble... Farewell!
/varset chickentimer 2m
}
}
|- Stop fighting if we lose our target
/if (${Me.Combat} && !${Target.ID}) /attack off
|- Are we suposed to stick to a target?
/if ((${Me.Combat} || ${strikeReady}) && ${Target.ID} && ${AutoStick} && (${Target.Distance}<${StickRangeToTarget}) && ${Target.Type.Equal[NPC]}) {
|- Check to see if we're too far from our tank (if applicable)
/if (${AutoAssist} && (${Spawn[${MainAssist}].Distance}>${StickRangeToTank})) {
/if (${useMU} && ${Stick.Status.Equal[ON]}) /squelch /stick off
/goto :DoneSticking
}
|- Check to see if we're mounted and dismount if so
/if (${Me.Buff[Summon Drogmor].ID} || ${Me.Buff[Summon Horse].ID}) /dismount
|- Use MQ2MoveUtils ? If so, start sticking and bypass RH movement tools
/if (${useMU}) {
/varset isTanking FALSE
/if (${aggrotimer.Value} || ${Me.TargetOfTarget.Name.Equal[${Me}]}) /varset isTanking TRUE
/if (!${Stick.Status.Equal[ON]} || ${snuggleup}) {
/if (${isTanking}) {
/squelch /stick ${Closeness}% mpause ${If[${Me.Swimming},uw,]}
} else {
/squelch /stick ${Closeness}% behind mpause ${If[${Me.Swimming},uw,]}
}
/varset snuggleup FALSE
} else {
/if (${Stick.MoveBehind}) {
/if (${isTanking}) {
/squelch /stick off
/if (${Verbosity}>=2) /${Channel} Switched to frontal sticking...
}
} else {
/if (!${isTanking}) {
/squelch /stick off
/if (${Verbosity}>=2) /${Channel} Maneuvering behind target again...
}
}
}
/goto :DoneSticking
}
/if (${Target.ID}) /face ${If[${Me.Swimming},,nolook]}
|- If we're too far away to hit it, get 1 second closer, unless we can hit it in less time
/if (${Target.Distance}>${Math.Calc[${Target.MaxRangeTo}*${Closeness}/100]}) {
|- Set current position first before potentially moving (in case we get stuck)
/varset X ${Me.X}
/varset Y ${Me.Y}
/if (!${Target.ID}) /goto :Foreverloop
|- Move
/keypress forward hold
/delay 1s ${Target.Distance}<${Math.Calc[${Target.MaxRangeTo}*${Closeness}/100]}
/keypress forward
|- Check to see if we got stuck trying that
/if ((${Me.X}==${X}) && (${Me.Y}==${Y})) {
|- We're stuck, back off a second, move left or right (randomly) for .5 seconds
/if (${Verbosity}>=2) /${Channel} We're STUCK on something, backing up...
/keypress back hold
/delay 1s
/keypress back
/if (${Math.Rand[2]}) {
/varset strafedir STRAFE_LEFT
} else {
/varset strafedir STRAFE_RIGHT
}
/if (${Verbosity}>=2) /${Channel} Unsticking: Strafing ${strafedir} a half-second...
/keypress ${strafedir} hold
/delay 5
/keypress ${strafedir}
}
}
/if (!${Target.ID}) /goto :Foreverloop
|- If we are close enough to hit it (and don't have aggro), lets try to get behind it a little bit at a time
/if ((${Target.Distance}<=${Target.MaxRangeTo}) && !${aggrotimer.Value} && !${Me.TargetOfTarget.Name.Equal[${Me}]}) {
/call Check_Behind
/varset behindTarget ${Macro.Return}
|- If we're not behind it, strafe around it a little
/if (!${behindTarget}) {
|- Which way do we strafe?
/varcalc delta ${Me.Heading.Clock}-${Target.Heading.Clock}
/if (${delta}>6) /varcalc delta ${delta}-12
/if (${delta}<-6) /varcalc delta ${delta}+12
/if (${delta}<0) {
/varset strafedir STRAFE_LEFT
} else {
/varset strafedir STRAFE_RIGHT
}
|- Set current position first before moving (in case we get stuck)
/varset X ${Me.X}
/varset Y ${Me.Y}
/if (!${Target.ID}) /goto :Foreverloop
|- Execute a strafe in the correct direction
/keypress ${strafedir} hold
/delay 2
/keypress ${strafedir}
/if (${Target.ID}) /face fast ${If[${Me.Swimming},,nolook]}
|- Check if we're stuck and warn if so (go through target to fix it)
/if ((${Me.X}==${X}) && (${Me.Y}==${Y})) {
/if (${Verbosity}>=2) /${Channel} We're STUCK trying to get behind target!
/delay 1s
}
}
}
} else {
/if (${useMU} && ${Stick.Status.Equal[ON]}) /squelch /stick off
}
:DoneSticking
|- Check on switching weapons (assuming it's a buff-weapon and buff is down)
/if (${WeaponSwitching} && ${wstype.Equal[Beneficial]}) {
/varset itemspellname ${FindItem[${Weapon1}].Spell}
/if (${itemspellname.NotEqual[${Me.Buff[${itemspellname}]}]} && !${FindItem[${Weapon1}].InvSlot.Name.Equal[mainhand]} && !${FindItem[${Weapon1}].InvSlot.Name.Equal[offhand]}) {
/if (${Verbosity}>=1) /${Channel} ** Beneficial proc-weapon swapping...
/call Weapon_Swap "${Weapon1}" "${Weapon2}"
}
}
|- Are we fighting?
/if (${Me.Combat}) {
|- ** We are fighting **
|- Respond to enraged targets
/if (${isEnraged} && ${Target.ID}) {
/call Check_Behind
/varset behindTarget ${Macro.Return}
/if (${Target.ID} && !${behindTarget}) {
/attack off
/if (${Verbosity}>=1) /${Channel} ** Attack ceased (Enrage Risk): ${Target.CleanName}
}
}
|- If we're sneaking, stop... since it serves no purpose and affects strafing
/if (${Me.Sneaking}) /doability "Sneak"
|- Check up on our autoassist targets if applicable, and switch if MA switches (1 second checks)
/if (${TargetSwitching} && ${AutoAssist} && ${Target.ID} && !${assisttimer}) {
/varset oldtargetID ${Target.ID}
/assist ${MainAssist}
/varset assisttimer 1s
}
|- Did we just switch targets? If so, turn off attack and start the loop over!
/if (${AutoAssist} && ${Target.ID}!=${oldtargetID}) {
/if (${Verbosity}>=1) /${Channel} --> *SWITCH* target to: ${Target.CleanName}
/varset oldtargetID ${Target.ID}
/attack off
/delay 2
/varset assisttimer 1s
/goto :ForeverLoop
}
|- Check for leash tugging and move back to stake some if so
/if (${Leashing}) {
/if (${LeashHolder.Equal[Nobody]} && (${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}>${LeashLength})) {
/if (${Verbosity}>=2) /${Channel} CHOKE! We're at the leash's length! (${LeashLength} ft.)
/if (${Verbosity}>=1) /${Channel} ** Autoassist is now OFF!
/varset AutoAssist FALSE
/attack off
/if (${useMU}) /squelch /stick off
/face ${If[${Me.Swimming},,nolook]} loc ${stakeY},${stakeX}
/keypress forward hold
/delay 1s ${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}
/keypress forward
|- Slow 180degree turns take time, and we may have turned off attack, so...
/goto :ForeverLoop
}
/if (!${LeashHolder.Equal[Nobody]} && ${Spawn[${LeashHolder}].ID} && (${Spawn[${LeashHolder}].Distance}>${LeashLength})) {
/if (${Verbosity}>=2) /${Channel} CHOKE! Tugging on ${LeashHolder}'s leash! (${LeashLength} ft.)
/if (${Verbosity}>=1) /${Channel} ** Autoassist is now OFF!
/varset AutoAssist FALSE
/attack off
/if (${useMU}) /squelch /stick off
/squelch /face ${If[${Me.Swimming},,nolook]} id ${Spawn[${LeashHolder}].ID}
/keypress forward hold
/delay 1s ${Spawn[${LeashHolder}].Distance}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}
/keypress forward
|- Slow 180degree turns take time, and we may have turned off attack, so...
/goto :ForeverLoop
}
|- Broken leash check
/if (!${LeashHolder.Equal[Nobody]} && !${Spawn[${LeashHolder}].ID}) {
/if (${Verbosity}>=1) /${Channel} ** Master DEAD or ZONED! Leash is BROKEN!
/varset Leashing FALSE
/varset LeashHolder Nobody
/ini "${INIFileName}" "General" "Leashing" "${Leashing}"
/ini "${INIFileName}" "General" "LeashHolder" "${LeashHolder}"
/goto :ForeverLoop
}
}
|- Are we standing, have a target, have backstab ready and can we stick it in the back?
/call Check_Behind
/varset behindTarget ${Macro.Return}
/if (${Target.ID} && ${Me.Standing} && !${Me.Casting.ID} && ${behindTarget} && (${Target.Distance}<${Math.Calc[${Target.MaxRangeTo}*${Closeness}/100]})) {
/if (${Me.AbilityReady["Backstab"]}) {
/doability "Backstab"
/if (${Verbosity}>=2) /${Channel} Backstabbing: ${Target.CleanName}
}
}
|- Are we tanking? If so, just stab it in the face if we can!
/if (${Target.ID} && ${Me.Standing} && !${Me.Casting.ID} && (${aggrotimer.Value} || ${Me.TargetOfTarget.Name.Equal[${Me}]})) {
/if (${Me.AbilityReady["Backstab"]} && ${InvSlot[mainhand].Item.Type.Equal[Piercing]}) {
/doability "Backstab"
/if (${Verbosity}>=1) /${Channel} Tanking -> Facestabbing: ${Target.CleanName}
}
}
|- Can we evade? Should we?
/if (${AutoEvade} && ${Target.ID} && !${Me.Casting.ID} && ${Me.AbilityReady["Hide"]} && (!${Me.Moving} || ${Me.AltAbilityReady[Nimble Evasion]})) {
/if (${Verbosity}>=2) /${Channel} Evading ${Target.CleanName}
/attack off
/delay 1
/doability "Hide"
/attack on
}
|- What's it got in it's pocketses?
/if (${AutoPickPocket} && ${Target.ID} && !${Me.Casting.ID} && (${Target.Distance}<15) && ${Me.AbilityReady["Pick Pockets"]}) {
/if (${Verbosity}>=2) /${Channel} Pick-pocketing ${Target.CleanName}
/attack off
/delay 1
/doability "Pick Pockets"
/attack on
/delay 1
/if (${Cursor.ID}) /autoinv
}
|- Are we so hurt we should stop fighting for a bit?
/if (${Me.PctHPs}<=${StopFightingHealth}) {
/attack off
/if (${Verbosity}>=1) /${Channel} Getting my ass kicked, ceasing combat!
}
|- Shall we do our optional discs?
/if (${AutoDisc1} && !${Disc1Reusetimer} && !${discactive} && !${strikeTimer} && ${Target.ID} && ${Target.PctHPs}>=50 && ${Me.PctEndurance}>=${Disc1Endurance}) {
/disc ${Disc1}
/if (${Verbosity}>=1) /${Channel} Disc #1: ${Disc1} activated
/delay 1s
/varset discactive 1m
/varset Disc1Reusetimer ${Disc1Reuse}m
}
/if (${AutoDisc2} && !${Disc2Reusetimer} && !${discactive} && !${strikeTimer} && ${Target.ID} && ${Target.PctHPs}>=50 && ${Me.PctEndurance}>=${Disc2Endurance}) {
/disc ${Disc2}
/if (${Verbosity}>=1) /${Channel} Disc #2: ${Disc2} activated
/delay 1s
/varset discactive 1m
/varset Disc2Reusetimer ${Disc2Reuse}m
}
} else {
|- ** We are not fighting
|- If we're not hiding or moving, check clicky maintained spells
/if (${Me.Invis} || ${Me.Moving} || ${clicktimer} || ${Me.State.Equal[BIND]}) /goto :DoneItemChecks
/varset i 1
:ItemCheckLoop
/varset ialias ${Ini[RHItems.ini].Arg[${i},|]}
/if (${ialias.NotEqual[NULL]}) {
|- Obtained an itemalias from the RHItems.ini file
|- We supposed to keep this spell up?
/if (${Ini[RHItems.ini,${ialias},KeepUp].Equal[FALSE]}) /goto :NextItem
|- Scan the item's bounce list for the active bouncers
/varset bouncenum 1
/varset doIclick TRUE
:BounceCheckLoop
/varset ibounce ${Ini[RHItems.ini,${ialias},BounceOff${bouncenum}]}
/if (${ibounce.NotEqual[NULL]}) {
/if (${ibounce.Equal[${Me.Buff[${ibounce}]}]}) /varset doIclick FALSE
} else /goto :DoneBounceChecks
/varcalc bouncenum ${bouncenum}+1
/goto :BounceCheckLoop
:DoneBounceChecks
|- By now we won't click the item if a bouncer spell is on us
|- Just have to check to see if the existing buff is on too
/varset itemspellname ${FindItem[${Ini[RHItems.ini,${ialias},FullName]}].Spell}
/if (${itemspellname.Equal[${Me.Buff[${itemspellname}]}]}) /varset doIclick FALSE
|- Finally, do it if we should
/if (${doIclick}) /docommand /iclick ${ialias}
|- Did we fail to find that previous item? (i.e. Dead and naked at bind point!)
/if (${clicktimer}) /goto :DoneItemChecks
:NextItem
/varcalc i ${i}+1
} else /goto :DoneItemChecks
/goto :ItemCheckLoop
:DoneItemChecks
|- Put the Closeness value back to the user's desired setting...
/varset Closeness ${Closenessdesired}
|- Lets hide and sneak if not already and we're set to do so **
/if (${AutoHideSneak} && ${Me.AbilityReady["Sneak"]} && !${Me.Casting.ID} && ${Me.State.NotEqual[BIND]} && !${Window[TradeWnd].Open} && !${Window[MerchantWnd].Open} && !${Window[BigBankWnd].Open}) /doability "Sneak"
/if (${AutoHideSneak} && ${Me.AbilityReady["Hide"]} && !${Me.Casting.ID} && ${Me.Sneaking} && (!${Me.Moving} || ${Me.AltAbilityReady[Nimble Evasion]}) && ${Me.State.NotEqual[BIND]} && !${Window[TradeWnd].Open} && !${Window[MerchantWnd].Open} && !${Window[BigBankWnd].Open}) /doability "Hide"
|- It's possible we're poised for a Strike, check and fight if so
/call Check_Behind
/varset behindTarget ${Macro.Return}
/if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Me.Standing} && ${Me.State.NotEqual[BIND]} && !${Me.Casting.ID} && ${behindTarget}) {
/if (${strikeReady} && ${Me.AbilityReady["Backstab"]}) {
/doability "Backstab"
/if (${Verbosity}>=1) /${Channel} Executing a strike: ${Target.CleanName}
/varset strikeReady FALSE
/attack on
}
}
|- It's also possible we never got behind a target and strike expired!
/if (${strikeReady} && ${Target.ID} && !${strikeTimer.Value} && ${Target.Type.Equal[NPC]}) {
/if (${Verbosity}>=2) /${Channel} Didn't find the back of a target in 30 seconds!
/varset strikeReady FALSE
/attack on
}
|- If we're set to autoassist, lets find a target
/if (${AutoAssist} && !${isEnraged} && !${Me.Casting.ID} && ${Me.State.NotEqual[BIND]}) {
|- Is main assist alive/in-zone?
/if (!${assisttimer} && !${strikeReady}) {
|- Lets try all the assists in priority order until we get an NPC to whack on
/if (!${Me.Casting.ID}) /assist ${FirstAssist}
/delay 1
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /goto :EngageCheck
/if (!${Me.Casting.ID}) /assist ${SecondAssist}
/delay 1
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /goto :EngageCheck
/if (!${Me.Casting.ID}) /assist ${ThirdAssist}
/delay 1
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) /goto :EngageCheck
|- If we got here and don't have a target, tanks are invalid or no fighting is going on
/goto :EndAutoassist
:EngageCheck
/varset oldtargetID ${Target.ID}
/varset assisttimer ${Math.Calc[10+${Math.Rand[5]}].Int}
|- Who is the valid tank?
/if (${FirstAssist.Equal[Main]} || (${Math.Distance[${Target.Y},${Target.X}:${Spawn[pc ${FirstAssist}].Y},${Spawn[pc ${FirstAssist}].X}]}<${Target.MaxRangeTo})) {
/varset MainAssist ${FirstAssist}
/goto :LastAttackCheck
}
/if (${SecondAssist.Equal[Main]} || (${Math.Distance[${Target.Y},${Target.X}:${Spawn[pc ${SecondAssist}].Y},${Spawn[pc ${SecondAssist}].X}]}<${Target.MaxRangeTo})) {
/varset MainAssist ${SecondAssist}
/goto :LastAttackCheck
}
/if (${ThirdAssist.Equal[Main]} || (${Math.Distance[${Target.Y},${Target.X}:${Spawn[pc ${ThirdAssist}].Y},${Spawn[pc ${ThirdAssist}].X}]}<${Target.MaxRangeTo})) {
/varset MainAssist ${ThirdAssist}
/goto :LastAttackCheck
}
/goto :EndAutoassist
:LastAttackCheck
|- Do we have an NPC targeted and is it hurt enough to attack?
/if (${Target.PctHPs}<=${AssistPercentage} && ${Target.Animation}!=32 && ${Target.Animation}!=110) {
/if (${Verbosity}>=1) /${Channel} --> Assisting ${MainAssist} on ${Target.CleanName} @ (${Target.PctHPs}%) HPs
/echo Seeking a Victim...
/goto :Foreverloop
}
}
}
:EndAutoassist
|- Are we supposed to look for traps?
/if (${TrapNegotiation}) {
/varset oldheading ${Me.Heading.DegreesCCW}
/if (${Me.AbilityReady["Sense Traps"]}) {
/doability "Sense Traps"
/if (${Verbosity}>=2) /${Channel} Looking for traps...
}
}
|- We could be on a leash, if so move 1s closer to our stake point (or master)\\
/if (${Leashing} && !${strikeReady}) {
/varset lastevent Event_Leashing
:LeashStart
|- Look for new events
/doevents
/if (!${lastevent.Equal[Event_Leashing]}) /goto :ForeverLoop
/if (${Me.Combat}) /goto :ForeverLoop
/if (${LeashHolder.Equal[Nobody]} && (${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}>${Math.Calc[${LeashLength}*${LeashFlex}/100]})) {
/if (${Verbosity}>=2) /${Channel} Moving closer to the Stake... ${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]} ft. away
/face ${If[${Me.Swimming},,nolook]} loc ${stakeY},${stakeX}
/keypress forward hold
/delay 1s ${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}) {
/if (${Verbosity}>=2) /${Channel} Arrived near enough to the Stake.
/face fast ${If[${Me.Swimming},,nolook]} away loc ${stakeY},${stakeX}
/goto :LeashEnd
}
/goto :LeashStart
}
/if (!${LeashHolder.Equal[Nobody]} && ${Spawn[${LeashHolder}].ID} && (${Spawn[${LeashHolder}].Distance}>${Math.Calc[${LeashLength}*${LeashFlex}/100]})) {
/if (${Verbosity}>=2) /${Channel} Moving closer to ${LeashHolder}... ${Spawn[${LeashHolder}].Distance} ft. away
/if (${Target.ID}!=${Spawn[${LeashHolder}].ID}) /target id ${Spawn[${LeashHolder}].ID}
/if (${Me.Combat}) /attack off
/face ${If[${Me.Swimming},,nolook]}
/keypress forward hold
/delay 1s ${Spawn[${LeashHolder}].Distance}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}
/keypress forward
/if (${Spawn[${LeashHolder}].Distance}<${Math.Calc[${LeashLength}*${LeashFlex}/100]}) {
/if (${Verbosity}>=2) /${Channel} Arrived near enough to Master (${LeashHolder}).
/goto :LeashEnd
}
/goto :LeashStart
}
|- Broken leash check
/if (!${LeashHolder.Equal[Nobody]} && !${Spawn[${LeashHolder}].ID}) {
/if (${Verbosity}>=1) /${Channel} ** Master DEAD or ZONED! Leash is BROKEN!
/varset Leashing FALSE
/varset LeashHolder Nobody
/ini "${INIFileName}" "General" "Leashing" "${Leashing}"
/ini "${INIFileName}" "General" "LeashHolder" "${LeashHolder}"
/goto :LeashEnd
}
:LeashEnd
}
}
/goto :ForeverLoop
/return