Code: Select all
| Beastlord Hunter Macro
| bsthunter.mac
| Author : ab2304
| Version : v1.0 2004-06-10 9:30pm EST
| Useage : /macro bsthunter
| Description : This macro will run your character around killing any mobs in your
| HunterMob.ini. Then it will attempt to loot all items in your
| HunterLoot.ini. Some of the upgrades made over Robdawg's hunter.mac :
| *Use a spell to pull instead of running up to the mob. This is
| great for tough areas with buildings and such.
| *Added an HunterAvoidMob.ini - Note: this part hasnt been tested much yet.
| *Keeps those buffs you have on. If you want to add buffs, add the appropriate Events.
| *Anchor code. Returns you to your starting spot after each kill.
| *Enhanced Looting. Will search out corpses that you havent looted incase of adds that pet kills.
| This is tested for the most part. Use at your own risk!
|------------------------------------------------------------------------------------
#include spellcast.inc
#event GettingHit "#*#YOU for #*#"
#Event GettingHit "#*#tries to #*#"
#Event SLAINBY "#*#You have been slain by#*#"
#turbo 10
Sub Main
|------------------------------------------------------------
|How many times should aquire target fail before delaying?
|------------------------------------------------------------
/declare AB_FailMax int outer 3
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare AB_MaxRadius int outer 3000
|------------------------------------------------------------
|How far is the combat range?
|------------------------------------------------------------
/declare AB_Range int outer 10
|------------------------------------------------------------
|What is the minimum Z Value of mobs I should target?
|------------------------------------------------------------
/declare AB_MinZRange int outer -200
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare AB_MaxZRange int outer 1000
|------------------------------------------------------------
|Should I loot all items?
|------------------------------------------------------------
/declare AB_LootAllItems int outer 0
|------------------------------------------------------------
|Should I display stats?
|------------------------------------------------------------
/declare AB_DisplayStats int outer 1
|------------------------------------------------------------
|How far away should I stop and cast spells?
|------------------------------------------------------------
/declare AB_SpellDistance int outer 140
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI HunterMob.ini "${Zone.Name}"
/if (!${Defined[AB_MobArray]}) {
/echo Mob Array Creation Error, ending macro...
/endmacro
}
|------------------------------------------------------------
|Mob Array Information.
|------------------------------------------------------------
/call ReadINI HunterLoot.ini "${Zone.Name}"
/if (!${Defined[AB_LootArray]}) {
/echo No Loot Array Created...
}
|------------------------------------------------------------
|Avoid Mob Array Information.
|------------------------------------------------------------
/call ReadINI HunterAvoidMob.ini "${Zone.Name}"
/if (!${Defined[AB_AvoidList]}) {
/echo No Avoid List Array Created...
}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare AB_FailCounter int outer 0
/declare AB_MyTargetID int outer 0
/declare AB_MyTargetName string outer
/declare AB_MyTargetDead int outer 0
/declare AB_InvalidTargetID int outer 0
/declare AB_HasTarget int outer 0
/declare AB_RandomWait int outer 0
/declare AB_LootSlot int outer 0
/declare AB_CheckLook int outer 0
/declare AB_Fighting int outer 0
/declare AB_TargetDead int outer 0
/declare AB_MyXLOC int outer 0
/declare AB_MyYLOC int outer 0
/declare AB_AnchorXLOC int outer 0
/declare AB_AnchorYLOC int outer 0
/declare AB_FastRange int outer
/declare AB_RangeMax int outer
/declare AB_RangeMin int outer
/declare AB_AcquireMobID int outer 0
/declare AB_SummonPetRange int outer 150
/declare AB_CastNow int outer 1
/declare AB_GettingHit int outer 0
/declare AB_AggroList[100] int outer NULL
/declare AB_AggroListTotal int outer 0
/declare AB_PetSpellName string outer "Spirit of Sorsha"
/declare AB_Slow string outer "Sha's Advantage"
/declare AB_NumberOfBuffs int outer 9
/declare AB_MyBuffs[${AB_NumberOfBuffs}] string outer
/declare AB_NumberOfPetBuffs int outer 8
/declare AB_PetBuffs[${AB_NumberOfPetBuffs}] string outer
/varcalc AB_FastRange ${AB_Range}+3
/varcalc AB_RangeMax ${AB_Range}+1
/varcalc AB_RangeMin ${AB_Range}-1
/varset AB_AnchorXLOC ${Int[${Me.X}]}
/varset AB_AnchorYLOC ${Int[${Me.Y}]}
|Buffs to be kept up on self
/varset AB_MyBuffs[1] "Spiritual Dominion"
/varset AB_MyBuffs[2] "Spirit of Wolf"
/varset AB_MyBuffs[3] "Infusion of Spirit"
/varset AB_MyBuffs[4] "Spiritual Vigor"
/varset AB_MyBuffs[5] "Frenzy"
/varset AB_MyBuffs[6] "Dexterity"
/varset AB_MyBuffs[7] "Furious Strength"
/varset AB_MyBuffs[8] "Regrowth"
/varset AB_MyBuffs[9] "Celerity"
|Buffs to be kept up on pet
/varset AB_PetBuffs[1] "Spirit of Wolf"
/varset AB_PetBuffs[2] "Infusion of Spirit"
/varset AB_PetBuffs[3] "Spiritual Strength"
/varset AB_PetBuffs[4] "Spirit of Rellic"
/varset AB_PetBuffs[5] "Dexterity"
/varset AB_PetBuffs[6] "Furious Strength"
/varset AB_PetBuffs[7] "Regrowth"
/varset AB_PetBuffs[8] "Arag`s Celerity"
/pet hold
/keypress esc
/lootn never
/fastdrop on
/echo Anchor dropped at ${AB_AnchorXLOC},${AB_AnchorYLOC}
/call MaintainBuffs
:Start
/call GMCheck
/call GetTarget
/if (${AB_HasTarget}) /call MoveToMob
/if (${AB_HasTarget}) /call CombatSub
/if (${AB_HasTarget} && (${Defined[AB_LootArray]} || ${AB_LootAllItems})) /call LootMob
/if (${AB_DisplayStats}) /call DisplayStats
/pet hold
/call ResetSub
/varset AB_RandomWait ${Math.Rand[5]}
/varcalc AB_RandomWait ${AB_RandomWait}+1
/echo Paranoia - Waiting ${AB_RandomWait} seconds before resuming
/delay ${AB_RandomWait}s
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/pet hold
/declare AB_CurrentRadius int local
/declare AB_TargetSub int local
/declare TempMobID int local
/declare i int local 1
/echo Looking for mobs.
:Acquire
/for AB_CurrentRadius 100 to ${AB_MaxRadius} step 100
/for AB_TargetSub 1 to ${AB_MobArray.Size}
/varset TempMobID ${NearestSpawn[${i}, radius ${AB_CurrentRadius} nopcnear notid ${AB_InvalidTargetID} npc ${AB_MobArray[${AB_TargetSub}]}].ID}
/varset AB_MyTargetID ${TempMobID}
/varset AB_MyTargetDead 0
/if (${AB_FailCounter}==6) /goto :Fail
/if (${TempMobID}) {
/if (${Int[${Spawn[${TempMobID}].PctHPs}]}<100) {
/echo Mob is at ${Spawn[${TempMobID}.PctHPs} Health, picking another...
/varcalc AB_FailCounter ${AB_FailCounter}+1
/varcalc AB_FailCounter ${AB_FailCounter}+1
/varset i ${i}+1
/varset TempMobID 0
/goto :Acquire
}
/if (${Int[${Math.Distance[${Spawn[${TempMobID}].Y},${Spawn[${TempMobID}].X}:${AB_AnchorYLOC},${AB_AnchorXLOC}]}]}>${AB_MaxRadius}) {
/echo Mob is to far away from Anchor Point
/varset i ${i}+1
/varset TempMobID 0
/varcalc AB_FailCounter ${AB_FailCounter}+1
/goto :Acquire
}
/if (${Int[${Spawn[${TempMobID}].Z}]}<${AB_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset AB_InvalidTargetID ${TempMobID}}
/varcalc AB_FailCounter ${AB_FailCounter}+1
/varset i ${i}+1
/varset TempMobID 0
/goto :Acquire
}
/if (${Int[${Spawn[${TempMobID}].Z}]}>${AB_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset AB_InvalidTargetID ${TempMobID}
/varcalc AB_FailCounter ${AB_FailCounter}+1
/varset i ${i}+1
/varset TempMobID 0
/goto :Acquire
}
/varset AB_HasTarget 1
/varset AB_AcquireMobID ${TempMobID}
/varset AB_MyTargetName ${Spawn[${TempMobID}].Name}
/echo Acquired ${Spawn[${TempMobID}].Name} at range ${Int[${Spawn[${TempMobID}].Distance}]} from us, and ${Int[${Math.Distance[${Spawn[${TempMobID}].Y},${Spawn[${TempMobID}].X}:${AB_AnchorYLOC},${AB_AnchorXLOC}]}]} from Anchor
/return
}
/next AB_TargetSub
/delay 2
/next AB_CurrentRadius
/if (!${TempMobID}) {
/delay 2s
/varcalc AB_FailCounter ${AB_FailCounter}+1
:Fail
|/echo Failed to Acquire Target in Range ${AB_MaxRadius} ${AB_FailCounter} Time(s)
/if (${AB_FailCounter}>=${AB_FailMax}) {
/echo Waiting for Respawns, So Heading to Anchor and Resetting Failure Counter...
/call MoveToAnchor
/echo Looking for Mobs again.
/varset AB_FailCounter 0
}
/goto :Acquire
}
/return
|--------------------------------------------------------------------------------
|SUB: Moving
|--------------------------------------------------------------------------------
Sub MoveToMob
/varset AB_MyXLOC ${Int[${Me.X}]}
/varset AB_MyYLOC ${Int[${Me.Y}]}
/declare AB_DistanceTimer timer 15
/declare Element int local 1
/declare TempMobID int local
/declare TempSingle int local 1
/declare AB_TargetSub int local
:MovementLoop
/doevents
/varset TempMobID ${NearestSpawn[1, radius ${AB_CurrentRadius} nopcnear notid ${AB_InvalidTargetID} npc ${AB_MobArray[${AB_TargetSub}]}].ID}
/if (${TempMobID}) {
/if (${TempMobID}!=${AB_AcquireMobID}) {
/if (${Spawn[${TempMobID}].Distance}<${Spawn[${AB_AcquireMobID}].Distance}) {
/echo Found a closer mob, ${Spawn[${TempMobID}].Cleanname}, which is only ${Spawn[${TempMobID}].Distance}, vs ${Spawn[${AB_AcquireMobID}].CleanName} which is ${Spawn[${AB_AcquireMobID}].Distance} Away! re-acquiring!
/call GetTarget
}
}
}
/varset TempMobID NULL
/if ((!${AB_Fighting})&&(!${AB_TargetDead})&&(${Spawn[${AB_AcquireMobID}].PctHPs}<100)) {
/echo ${Spawn[${AB_AcquireMobID}].CleanName} is at ${Spawn[${AB_AcquireMobID}].PctHPs} health, picking another...
/varset AB_InvalidTargetID ${Spawn[${AcquireMobID}]}
/varset AB_HasTarget 0
/call ResetSub
/return
}
:AvoidCheckLoop
/squelch /varset TempMobID ${NearestSpawn[${AB_AvoidList[${Element}]}].ID}
/if (${Int[${Spawn[${TempMobID}].Distance}]}<400) {
/echo ${Spawn[${TempMobID}].CleanName} is at ${Spawn[${TempMobID}].Distance}
/echo AVOIDING ${Spawn[$TempMobID}].CleanName}
/pet back off
/pet hold
/pet follow
/call MoveToAnchor
/return
}
}
/varcalc Element ${Element}+1
/if (${AvoidList[${Element}].NotEqual[UNDEFINED-ARRAY-ELEMENT]}) {
/goto :AvoidCheckLoop
}
/if (${AB_AcquireMobID}) {
/squelch /face ID ${AB_AcquireMobID}
}
/if (${Int[${Spawn[${AB_AcquireMobID}].Distance}]}>${AB_FastRange}) {
/keypress forward hold
} else /keypress forward
/if (${Int[${Spawn[${AB_AcquireMobID}].Distance}]}<${AB_SpellDistance}) {
/if (${AB_Fighting}==0) {
/target ${Spawn[${AB_AcquireMobID}]}
}
/if (${AB_CastNow}==1) {
/keypress forward
/delay 10
/call Cast ${AB_Slow}
/varset AB_CastNow 2
/return
}
}
/if ((${Int[${Spawn[${AB_AcquireMobID}].Distance}]}<${AB_FastRange})&&(${Int[${Spawn[${AB_AcquireMobID}].Distance}]}>${AB_RangeMax})) {
/keypress forward
}
/if (${Int[${Spawn[${AB_AcquireMobID}].Distance}]}<${AB_RangeMin}) {
/keypress back
}
/if (!${AB_DistanceTimer}) {
/if ((${AB_MyXLOC}==${Int[${Me.X}]})&&(${AB_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset AB_MyXLOC ${Int[${Me.X}]}
/varset AB_MyYLOC ${Int[${Me.Y}]}
/varset AB_DistanceTimer 15
/goto :Movementloop
}
/if (${Int[${Spawn[${AB_AcquireMobID}].Distance}]}>${AB_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/declare AggroLoop int inner 0
/declare i int local 1
/echo Attacking Mob NOW!
/varset AB_Fighting 1
/varset AB_TargetDead 0
:CombatLoop
/doevents
/attack on
/if (${AB_CastNow}==3) {
/call MoveToMob
/varset AB_GettingHit 0
} else {
/if (${AB_GettingHit}==1) {
/varset AB_CastNow 3
/pet attack
}
}
/call SpecialIT
/if (${Target.ID}) {
/face ${Target}
} else {
/for AggroLoop 1 to ${AB_AggroListTotal}
|/echo ${Spawn[${AB_AggroList[${i}-1]}].CleanName} SHOULD be on the list, exact copy except -1 removed from i
|/echo ${AB_AggroList[${i}]} is the mob we are checking to be existing! ${AB_AggroList[1]} exists?! i is ${i}
/if (${AB_AggroList[${i}]}) {
/if (${Spawn[${AB_AggroList[${i}]} corpse]}) {
|/echo ${Spawn[${AB_AggroList[${i}]} corpse]}
|/echo We have Another Aggroed Mob, ${Spawn[${AB_AggroList[${i}]}].CleanName} with ${Spawn[${AB_AggroList[${i}]}].PctHPs} % hps.
/target ${Spawn[${AB_AggroList[${i}]}]}
/varset AB_AcquireMobID ${Target.ID}
/delay 1s
/call Cast ${AB_Slow}
/call CombatSub
} else {
/varcalc i ${i}+1
/attack off
/varset AB_TargetDead 1
/varset AB_Fighting 0
/varset AB_CastNow 0
|/echo One of the mobs in our aggro list Is now Dead! YEAH!
/next AggroLoop
|/echo No more mobs on the Aggro List!
/return
}
}
}
}
/if (!${AB_TargetDead}) {
/goto :CombatLoop
}
/varset AB_CastNow 0
/return
|--------------------------------------------------------------------------------
|SUB: Special Combat
|--------------------------------------------------------------------------------
Sub SpecialIt
/declare TempID int inner 0
/doevents
/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"
/if ((${Int[${Me.PctHPs}]}<50)) {
/call Cast "Chloroblast"
}
/return
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/declare AggroLoop int inner 0
/declare i int local 1
/declare iCount int local 1
/doevents
/for AggroLoop 1 to ${AB_AggroListTotal}
/if (${AB_AggroList[${i}]}) {
/squelch /target ${Spawn[${AB_AggroList[${i}]}]}
|/echo Targeted a ${Spawn[${AB_AggroList[${i}]}].CleanName}
/varset AB_AcquireMobID ${Target.ID}
}
/varcalc i ${i}+1
/call RemoveAggroMob
/if (${Target.Distance}>25) {
/keypress forward hold
/face fast nolook
}else /keypress forward
/face fast nolook
/keypress forward
/keypress back
/delay 1s
/loot
/varset AB_AcquireMobID 0
/delay 1s
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/keypress esc
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup
/delay 1s
/if (${AB_LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 1s
} else {
/for LootCheck 1 to ${AB_LootArray.Size}
/if (!${Me.FreeInventory}) {
/beep
/beep
/beep
/beep
/echo ** INVENTORY FULL !
/call MoveToAnchor
/endmacro
}
/if (${Cursor.Name.Find[${AB_LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/varcalc AB_LootStats[${LootCheck}] ${AB_LootStats[${LootCheck}]}+1
/autoinventory
/delay 1s
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 1s
}
/next LootSlot
/keypress esc
/next AggroLoop
:LootOther
/keypress esc
/delay 15
/squelch /target ${NearestSpawn[corpse radius 200 nopcnear "${AB_MobArray[${iCount}]}"]}
/if (${Target.ID}) {
/varset AB_AcquireMobID ${Target.ID}
/call MoveToMob
/echo We have another corpse in the area, going to get it.
/call LootMob
}
/varcalc iCount ${iCount}+1
/if ((${Int[${iCount}]}<${Int[${AB_MobArray.Size}]})) /goto :LootOther
/keypress esc
/return
|--------------------------------------------------------------------------------
|SUB: Remove Mob From the Aggro List, dead and looted
|--------------------------------------------------------------------------------
Sub RemoveAggroMob
/declare i int local 1
/declare iCount int local 1
/declare AggroLoop int inner 0
/declare InnerAggroLoop int inner 0
/declare temp int local 0
/for AggroLoop 1 to ${AB_AggroListTotal}
/if (${Target.ID}==${AB_AggroList[${iCount}]}) {
/varset AB_AggroList[${iCount}] UNDEFINED-ARRAY-ELEMENT
/varcalc i ${iCalc}+1
/for InnerAggroLoop 1 to ${AB_AggroList[${i}]!=NULL
/varcalc i ${i}+1
/next InnerAggroLoop
/varset AB_AggroList[${iCount}] ${AB_AggroList[${i}]}
/varset AB_AggroList[${i}] UNDEFINED-ARRAY-ELEMENT
/varcalc iCount ${iCount}+1
}
/next AggroLoop
/varcalc AB_AggroListTotal ${AggroListTotal}-1
/doevents
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
|/call MoveToAnchor
/keypress esc
/doevents
/call MaintainBuffs
/if (${Me.AltAbilityReady[Paragon of Spirit]}) {
/call Cast "Paragon of Spirit" activate
/delay 6s
}
/keypress esc
/varset AB_HasTarget 0
/varset AB_TargetDead 0
/varset AB_Fighting 0
/varset AB_CastNow 1
/doevents
/return
|--------------------------------------------------------------------------------
|SUB: MaintainBuffs
|--------------------------------------------------------------------------------
Sub MaintainBuffs
/declare PetBuffLoop int inner 0
/declare MyBuffLoop int inner 0
/declare iCount int 1
/declare tmp
/doevents
/for MyBuffLoop 1 to ${AB_NumberOfBuffs}
/if (!${Me.Buff[${AB_MyBuffs[${iCount}]}].ID}) {
/target ${Me}
/call Cast ${AB_MyBuffs[${iCount}]}
/delay 1s
/if (${iCount}==5) /delay 20s
/doevents
}
/varcalc iCount ${iCount}+1
/next MyBuffLoop
/varset iCount 1
|If we have pet, make one
/if ( !${Me.Pet.ID} ) {
/echo Creating new pet
/call Cast ${AB_PetSpellName}
/delay 1s
/target ${Me.Pet.Name}
/call Cast "Shrink"
}
/if ( ${Me.Pet.Distance}>${AB_SummonPetRange}) {
/echo Summoning pet. Its range is ${Me.Pet.Distance}
/call Cast "Summon Companion"
/delay 1s
}
/for PetBuffLoop 1 to ${AB_NumberOfPetBuffs}
/if (!${Me.PetBuff[${AB_PetBuffs[${iCount}]}]}) {
/target ${Me.Pet.Name}
/call Cast ${AB_PetBuffs[${iCount}]}
/delay 1s
/doevents
}
/varcalc iCount ${iCount}+1
/next PetBuffLoop
/keypress esc
/return
|-------------------------------------------------------------------------------
|Return to Anchor
|-------------------------------------------------------------------------------
Sub MoveToAnchor
/declare iCount int local
/declare TempMobID int local
/declare Element int local 1
/declare AB_DistanceTimer int local 30
/varset AB_MyXLOC ${Me.X}
/varset AB_MyYLOC ${Me.Y}
/varset iCount 0
/doevents
/echo Moving to Anchor at Loc: ${AB_AnchorXLOC}, ${AB_AnchorYLOC}.
:AnchorMoveLoop
/delay 1
:AvoidCheckLoopAnchor
/varset TempMobID ${NearestSpawn[npc radius 400 ${AB_AvoidList[${i}]}]}
/if (${TempMobID}!=NULL) {
/echo OOOPS, avoiding Mob
/if (${TempMobID}) {
/face nolook ${TempMobID}
/if (${Math.Rand[2]}) {
/echo ack 1
/keypress strafe_right hold
/keypress back hold
} else {
/echo ack 2
/keypress strafe_left hold
/keypress back hold
}
/delay ${Math.Calc[${Math.Rand[15]}+30]}
/echo ack 3
/keypress strafe_right
/keypress forward
/keypress strafe_left
}
}
/varcalc Element ${Element}+1
/if (${AvoidList[${Element}].NotEqual[UNDEFINED-ARRAY-ELEMENT]}) {
/goto :AvoidCheckLoopAnchor
}
|/face nolook loc $(+{AB_AnchorXLoc}),$(+{AB_AnchorYLoc})
/face nolook loc ${AB_AnchorYLOC},${AB_AnchorXLOC}
/if (${Math.Distance[${AB_AnchorYLOC},${AB_AnchorXLOC}]}>10) {
/keypress forward hold
} else {
/keypress forward
/echo Moved to Anchor at Loc: ${Me.X}, ${Me.Y}.
/return
}
/if (${AB_DistanceTimer}==1) {
/if ((${AB_MyXLOC}==${Int[${Me.X}]})&&(${AB_MyYLOC}==${Int[${Me.Y}]})) {
/call HitObstacle
/echo hit obstacle? ${AB_MyXLOC},${AB_MyYLOC} = ${Me.X},${Me.Y} ?
}
/varset AB_MyXLOC ${Int[${Me.X}]}
/varset AB_MyYLOC ${Int[${Me.Y}]}
/varset AB_DistanceTimer 30
|/face nolook loc ${AnchorYLOC},${AnchorXLOC}
/goto :AnchorMoveLoop
}
/varcalc AB_DistanceTimer ${AB_DistanceTimer}-1
/goto :AnchorMoveLoop
}
/echo End Of Anchor Loop
/goto :AnchorMoveLoop
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay ${Math.Calc[${Math.Rand[5]}+6]}
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
/keypress forward hold
} else {
/keypress strafe_left hold
/keypress forward hold
}
/delay ${Math.Calc[${Math.Rand[15]}+12]}
/keypress strafe_right
/keypress strafe_left
/return
|--------------------------------------------------------------------------------
|SUB: GM Check
|--------------------------------------------------------------------------------
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM has entered the zone!
/echo FUCK HIM but ending the macro...
/keypress forward
/keypress back
/quit
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName)
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 1s
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (!${KeySet.Arg[${nValues},|].Length}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["HunterMob.ini"]}&&${nValues}>0) {
/echo Declaring Mob Array...
/declare AB_MobArray[${nValues}] string outer
/declare AB_MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare AB_LootArray[${nValues}] string outer
/declare AB_LootStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterAvoidMob.ini"]}&&${nValues}>0) {
/echo Declaring AvoidMob Array...
/declare AB_AvoidList[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset AB_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${KeySet.Arg[${nArray},|]},NULL]}
/varset AB_MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset AB_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${KeySet.Arg[${nArray},|]},NULL]}
/varset AB_LootStats[${nArray}] 0
}
/if (${FileName.Equal["HunterAvoidMob.ini"]}) {
/varset AB_AvoidList[${nArray}] ${Ini[${FileName},${SectionName},${KeySet.Arg[${nArray},|]},NULL]}
/echo ${AB_AvoidList[${nArray}]}
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1s
/return
|--------------------------------------------------------------------------------
|SUB: Display Stats
|--------------------------------------------------------------------------------
Sub DisplayStats
/declare nArray int local
/if (${Defined[AB_LootArray]}) {
/for nArray 1 to ${AB_LootArray.Size}
/echo ${Int[${AB_LootStats[${nArray}]}]} ${AB_LootArray[${nArray}]}'s
/next nArray
}
/return
| ----- Events called by /DoEvents -----
Sub Event_GettingHit
/varset AB_GettingHit 1
/declare TempMobID int 0
/declare AggroLoop int local 0
/declare OuterAggroLoop int local 0
/declare iCount int local 1
/declare i int local 1
/declare MobX int local 0
/declare MobY int local 0
/declare MobsHeading int local 0
/declare MyHeadingToMob int local 0
/declare NewAdd int local 0
/declare temp int local 0
/for OuterAggroLoop 1 to 20
/varset TempMobID ${NearestSpawn[${iCount}, npc radius 40].ID}
/if (${TempMobID}==NULL) /return
/varset MobX ${NearestSpawn[${iCount}, npc radius 40].X}
/varset MobY ${NearestSpawn[${iCount}, npc radius 40].Y}
/varset MobsHeading ${NearestSpawn[${iCount}, npc radius 40].Heading.Clock}
/varset MyHeadingToMob ${Heading[${MobY},${MobX}].Clock}
/varcalc temp ${MyHeadingToMob}-${MobsHeading}
/if (${temp}<0) {
/varcalc temp ${temp}+12
}
/if ((${temp}>4)&&(${temp}<8)) {
/for AggroLoop 1 to ${AB_AggroListTotal}
/if (${TempMobID}==${AB_AggroList[${i}]}) {
/varset NewAdd 1
|/echo Mob already on list!
}
/varcalc i ${i}+1
/next AggroLoop
/if (${NewAdd}==0) {
/varcalc i ${i}-1
/varset AB_AggroList[${i}] ${TempMobID}
/varcalc AB_AggroListTotal ${AggroListTotal}+1
/echo ${Spawn[${AB_AggroList[${i}]}].CleanName} added to aggro list!
|/call PrintAggroList
}
}
/varset i 1
/varcalc iCount ${iCount}+1
/next OuterAggroLoop
/varset AB_GettingHit 1
/return
Sub PrintAggroList
/declare AggroLoop int local 0
/declare i int 1
/echo AggroList now Contains :
/for AggroLoop 1 to ${AB_AggroListTotal}
/echo ${Spawn[${AB_AggroList[${i}]}].CleanName} at ${Spawn[${AB_AggroList[${i}]}].PctHPs} health, ${Spawn[${AB_AggroList[${i}]}].Distance} units away.
/varcalc i ${i}+1
/next AggroLoop
/returnCode: Select all
[Eastern Plains of Karana]
Mob1=Spider
Mob2=Lion
Mob3=Griffawn
[East Commonlands]
Mob1=Spiderling
[The Feerrott]
Mob1=Spider
[The Overthere]
Mob1=berzerker
Mob2=sarnak
Code: Select all
[Eastern Plains of Karana]
Loot1=Silk
Loot2=High Quality
Loot3=Medium Quality
Loot4=Feather
[East Commonlands]
Loot1=Spiderling Silk
[The Feerrott]
Loot1=Spiderling Silk
[The Overthere]
Loot1=A Sarnak War Braid
Code: Select all
[The Overthere]
Mob1=Dragoon
Mob2=General


