| Simple Camp Macro
| SimpleCamp.mac
|
| Author : Nightmare327 (with original source from robdawg's and Chill's code
| Version : v1.0.0 2007-08-20
| Useage : /macro SimpleCamp
| Description : This macro will sit there waiting for a mob to aggro on you then kill
| and loot the mob. It requires the ninjadvloot.inc and loot.ini files.
| Based heavily on robdawg's Hunter.mac, then Chill's Monk hunter macro,
| then modded to make it simpler
|------------------------------------------------------------------------------------
#turbo 20
| #Include SpellCast.inc
| #Include Swap.inc
#include Ninjadvloot.inc
#include Move.inc
#event TooFarAway "#*#Your target is too far away#*#"
Sub Main
|------------------------------------------------------------
|How far is the combat range?
|------------------------------------------------------------
/declare MF_Range int outer 10
|------------------------------------------------------------
|How many times should I be out of range before moving back?
|------------------------------------------------------------
/declare OOR_FailMax int outer 5
|------------------------------------------------------------
|Counter for OOR check
|------------------------------------------------------------
/declare OOR_Counter int outer 0
|------------------------------------------------------------
|Should I display stats?
|------------------------------------------------------------
/declare MF_DisplayStats int outer 0
|------------------------------------------------------------
|How many ticks should I let buffs run down to?
|------------------------------------------------------------
/declare MF_BuffTicks int outer 20
|------------------------------------------------------------
|What percent should I not engage mobs under? (anti KS code)
|------------------------------------------------------------
/declare MF_EngageHP int outer 98
|------------------------------------------------------------
|HP below which to rest
|------------------------------------------------------------
/declare HPHealRest int outer 80
|------------------------------------------------------------
|HP below which to start up again
|------------------------------------------------------------
/declare HPRestart int outer 90
|------------------------------------------------------------
|Generic Counter Variable
|------------------------------------------------------------
/declare c int outer 0
|------------------------------------------------------------
|Should I Return home during resets?
|------------------------------------------------------------
/declare MF_ReturnHome int outer 1
|------------------------------------------------------------
|Home Location Storage
|------------------------------------------------------------
/declare home_x int outer ${Me.X}
/declare home_y int outer ${Me.Y}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare MF_FailCounter int outer 0
/declare MF_ObstacleCounter int outer 0
/declare MF_MyTargetID int outer 0
/declare MF_MyTargetName string outer
/declare MF_MyTargetDead int outer 0
/declare MF_InvalidTargetID int outer 0
/declare MF_HasTarget int outer 0
/declare MF_RandomWait int outer 0
/declare MF_LootSlot int outer 0
/declare MF_CheckLook int outer 0
/declare MF_Fighting int outer 0
/declare MF_TargetDead int outer 0
/declare MF_MyXLOC int outer 0
/declare MF_MyYLOC int outer 0
/declare MF_FastRange int outer
/declare MF_RangeMax int outer
/declare MF_RangeMin int outer
/varcalc MF_FastRange ${MF_Range}+3
/varcalc MF_RangeMax ${MF_Range}+1
/varcalc MF_RangeMin ${MF_Range}-1
/declare MF_HasteGloves string outer
| /varset MF_HasteGloves Gauntlets of Enlightenment
|Part of the Ninjadvloot.inc setup
/call SetupAdvLootVars
|Part of the Ninjadvloot.inc setup - overrides the looting If mobs are close
|I set to thi Value so trivial mobs dont stop Me from looting
/varset MobsTooClose 2
/fastdrop on
/lootn never
:Start
/doevents
/call GMCheck
| /call BuffCheck
/call HealthCheck
:KillAdds
/if (${MF_HasTarget}) /call MoveToMob
/if (${MF_HasTarget}) /call CombatSub
/if (${MF_HasTarget}) /call MoveToMob
/if (${Target.Type.Equal[Corpse]}) /call LootMobs
/if (${MF_DisplayStats}) /call DisplayStats
/call ResetSub
/if (${SpawnCount[pc]}>(${Group.Members}+1)) {
/varset MF_RandomWait ${Math.Rand[10]}
/varcalc MF_RandomWait ${MF_RandomWait}+1
|/echo Paranoia - Waiting ${MF_RandomWait} seconds before resuming
/delay ${MF_RandomWait}s
}
/squelch /target clear
/delay 10s
/if (${Target.ID}) {
/echo Looks like something is attacking us, killing it...
/delay 2
/varset MF_HasTarget 1
/varset MF_Fighting 1
/goto :KillAdds
}
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: Moving
|--------------------------------------------------------------------------------
Sub MoveToMob
/varset MF_MyXLOC ${Int[${Me.X}]}
/varset MF_MyYLOC ${Int[${Me.Y}]}
/declare MF_DistanceTimer timer 15
/doevents
:MovementLoop
|if not yet fighting, the only player in the zone, and you run over a mob not your target, check if you want to kill it.
/if (!${MF_Fighting} && ${SpawnCount[pc]}==1 && ${SpawnCount[npc radius 40]} && ${Target.Distance}>40) /call GetTarget 50
/if (!${MF_Fighting} && !${MF_TargetDead}) {
/if (${Int[${Target.PctHPs}]}<${MF_EngageHP} && ${SpawnCount[pc]}>1) {
/echo ${Target.CleanName} already engaged at ${Target.PctHPs}% health, picking another...
/varset MF_InvalidTargetID ${Target.ID}
/varset MF_HasTarget 0
/call ResetSub
/return
}
}
/if (${Target.ID}) /face fast
/if (${Int[${Target.Distance}]}>${MF_FastRange}) {
/keypress forward hold
}
/if (${Int[${Target.Distance}]}<${MF_FastRange}&&${Int[${Target.Distance}]}>${MF_RangeMax}) {
/keypress forward
}
/if (${Int[${Target.Distance}]}<${MF_RangeMin}) {
/keypress back
}
/if (!${MF_DistanceTimer}) {
/if ((${MF_MyXLOC}==${Int[${Me.X}]})&&(${MF_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset MF_MyXLOC ${Int[${Me.X}]}
/varset MF_MyYLOC ${Int[${Me.Y}]}
/varset MF_DistanceTimer 15
/goto :Movementloop
}
/if (${Int[${Target.Distance}]}>${MF_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/echo Attacking ${Target.CleanName} NOW!
/varset MF_Fighting 1
/varset MF_TargetDead 0
:CombatLoop
/doevents
/if (${MF_HasteGloves.Equal[${Me.Inventory[hands]}]} && !${Me.Buff["Celestial Tranquility"].Duration}) /cast item "${MF_HasteGloves}"
/delay 1
/attack on
/call MoveToMob
/call SpecialIT
/if (!${Target.ID} || ${Target.Type.Equal[Corpse]}) {
/attack off
/keypress forward hold
/keypress back
/varset MF_TargetDead 1
/varset MF_Fighting 0
/target npc corpse radius 40
/delay 1
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${MF_TargetDead}) {
/goto :CombatLoop
}
/return
|--------------------------------------------------------------------------------
|SUB: Special Combat
|--------------------------------------------------------------------------------
Sub SpecialIt
/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Flying Kick"]})) /doability "Flying Kick"
/if (${Int[${Me.PctHPs}]}<30) {
|Activate HOT potion
/potionbelt activate 1
}
/if ((${Int[${Me.PctHPs}]}<40) && ${Me.AbilityReady["Mend"]}) {
/echo Mending at ${Me.PctHPs} health...
/doability "Mend"
}
/if (${Int[${Me.PctHPs}]}<30) {
/echo Getting my ass kicked, feigning death...
/cleanup
/keypress esc
/attack off
/keypress forward
/keypress back
/delay 1
/doability "Feign Death"
/beep
/beep
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/if (${Corpse.Open}) /notify LootWnd DoneButton leftmouseup
| /cleanup
| /keypress esc
| /target clear
/delay 1
/call LootMobs
/varset MF_HasTarget 0
/varset MF_TargetDead 0
/varset MF_Fighting 0
/if (${MF_ReturnHome}) {
/if ( ${Math.Distance[${Me.Y},${Me.X}:${home_y},${home_x}]} > 5 ) /call MoveToLoc ${home_y} ${home_x}
}
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/if (${Corpse.Open}) /notify LootWnd DoneButton leftmouseup
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 5
/keypress back
/if (${Math.Rand[100]}+1>50) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/delay 1
/keypress jump
/if (${MF_ObstacleCounter}>=10) {
/echo Hit obstacle too many times, Target being blocked...
/delay 2s
/varset MF_ObstacleCounter 0
/varset MF_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varcalc MF_ObstacleCounter ${MF_ObstacleCounter}+1
/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}...
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1
/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 MF_MobArray[${nValues}] string outer
/declare MF_MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare MF_LootArray[${nValues}] string outer
/declare MF_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset MF_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${KeySet.Arg[${nArray},|]},NULL]}
/varset MF_MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset MF_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${KeySet.Arg[${nArray},|]},NULL]}
/varset MF_LootStats[${nArray}] 0
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1
/return
|--------------------------------------------------------------------------------
|SUB: Display Stats
|--------------------------------------------------------------------------------
Sub DisplayStats
/declare nArray int local
/if (${Defined[MF_LootArray]}) {
/for nArray 1 to ${MF_LootArray.Size}
/if (${Int[${MF_LootStats[${nArray}]}]} > 0) /echo (${Int[${MF_LootStats[${nArray}]}]}) ${MF_LootArray[${nArray}]}'s
/next nArray
}
/return
|--------------------------------------------------------------------------------
|SUB: Buff Check - Monk Specific, but can be edited for other classes
|--------------------------------------------------------------------------------
Sub BuffCheck
/echo Checking Buffs...
/if (!${Me.Standing} && !${Me.Mount.ID}>0) /stand
/if (${Me.Moving}) {
/keypress forward
/keypress back
/delay 5
}
/if (${Me.Buff["Vengeful Guard"].Duration} < ${MF_BuffTicks}) /call cast "Cloak of Retribution" item
/for c 1 to 15
/if (${Me.Buff[${c}].Name.Find["boar"]} || ${Me.Buff[${c}].Name.Find["bear"]} || ${Me.Buff[${c}].Name.Find["stamina"]}) /goto :nosta
/next c
/if (${Me.Buff["Health"].Duration} < ${MF_BuffTicks}) {
/target myself
/delay 1
/call swap "swap:Ton Po's Leggings of Composure=Leggings of Enlightenment|clicky:Leggings of Enlightenment|swap:Leggings of Enlightenment=Ton Po's
Leggings of Composure"
/delay 1
/target clear
}
:nosta
/if (!(${MF_HasteGloves.Equal[${Me.Inventory[hands]}]} || ${Me.Buff["Strength of Tunare"].Duration} || ${Me.Buff["Spiritual Vigor"].Duration} ||
${Me.Buff["Celestial Tranquility"].Duration})) {
/if (${Me.Buff["Grim Aura"].Duration} < ${MF_BuffTicks}) /call swap "swap:Resonating Earring of Battle=Shrunken Goblin Skull Earring|clicky:Shrunken
Goblin Skull Earring|swap:Shrunken Goblin Skull Earring=Resonating Earring of Battle"
}
/for c 1 to 15
/if (${Me.Buff[${c}].Name.Find["focus"]}) /goto :focused
/next c
/if (${Me.Buff["Shield of the Arcane"].Duration} < ${MF_BuffTicks}) /call swap "swap:Stonehide Tunic=Chestwraps of
Enlightenment|clicky:chest|swap:Chestwraps of Enlightenment=Stonehide Tunic"
/delay 1
:focused
/return
|--------------------------------------------------------------------------------
|SUB: Health Check - lower level checks more often, after each mob actually
|--------------------------------------------------------------------------------
Sub HealthCheck
|/echo Checking Health...
/if (!${Me.Standing} && !${Me.Mount.ID}>0) /stand
/if (${Me.Moving}) {
/keypress forward
/keypress back
/delay 5
}
|Do I need to heal during downtime?
/if (${Int[${Me.PctHPs}]}>=${HPHealRest}) {
/return
}
/if ( (${Me.PctHPs} < ${HPHealRest}) && (!${Me.Combat}) && (${Me.Standing}) ) {
/sit
}
:HealLoop
/if (${Int[${Me.PctHPs}]}>=${HPRestart}) {
/stand
/return
}
/squelch /target clear
/delay 5s
/if (${Target.ID}) {
/echo Looks like something is attacking us, killing it...
/delay 2
/varset MF_HasTarget 1
/varset MF_Fighting 1
/return
}
/target ${Me.CleanName}
/if (${Me.PctHPs} < 60) {
/doability "Bind Wound"
}
/delay 12s
/if (${Int[${Me.PctHPs}]}<${HPRestart}) {
/goto :HealLoop
}
/stand
/squelch /target clear
}
/return
Sub TooFarAway
/varcalc OOR_Counter ${OOR_Counter} + 1
/if ( ${OOR_Counter} <= ${OOR_FailMax} ) {
/return
}
/echo Backing up so I can hit the git
/keypress down hold
/delay 5s
/keypress up
/varset OOR_Counter 0
/return