Basically, this hunts for Hill Giants in RM and pet kites them. Took awhile to get everything working properly but it's all tested except for the GM avoidance stuff. It all works as intended.
Thanks to grimjack for the help with the movetocorpse sub.
P.S. Turn off wordwrap in notepad when you paste this. Some of the lines may run long so if you get syntax errors, just reset the stuff that's overflowing on to the next line.
Code: Select all
giants.mac
| Hill Giant Hunter for Necromancers by elretardo
|
| Credits:
| Original Script by grimjack
| New Anti-KS concept by switch, created by elretardo
| Prioritized hunting enhancement by theafkxper
|
| Note: Made this for my 65 necromancer. Adjust the /cast properties as needed for
| lower level characters. Sorry about the cast spam but I didn't feel like
| making fizzle recasts event driven.
|
| Oh yeah, you can use this for stuff other than hill giants by adjusting the
| mob/loot arrays. Don't try it on stuff that will kick your ass though because
| I don't have any pet healing in there except for after the kill.
|
| DON'T FORGET TO SET THE USER VARIABLES AT THE /DECLARE POINTS.
|
| Also: Try typing /huntstats for some statistics about the script :)
|
| ADDED SILVER/COPPER DESTROY FUNCTION BUT IT IS MOUSE
| LOCATION SENSATIVE. IF YOU WANT TO USE IT, UNCOMMENT
| THE LINES AT THE BOTTOM OF THE SCRIPT BUT *ONLY AFTER*
| YOU DEFINE THE LOCATIONS OF YOUR COPPER AND SILVER
| SLOTS.
|
|
| v2.0 Notes from grimjack
|
| Hunt script with loot for new loot parser.
| As always much of this script is inspired or taken directly from
| pieces of macro's found at macroquest2.com's macro depot
| Thank you to all the people who have donated their scripts which
| made this possible. And thank you to the MQ developers.
|
| Edit /varset MainArray(1,0) "silk" and /varset MainArray(1,1) "skin"
| Also edit /varset MainArray(2,0) "widow" and /varset MainArray(2,1) "wolf"
| You can also make these arrays bigger. If you want to search for
| wolfs, widows and orcs you would have this
| /varset MainArray(2,0) "widow"
| /varset MainArray(2,1) "wolf"
| /varset MainArray(2,2) "orc"
| /varset MobArraySize 3
| This picks a random number based on MobArraySize to pick which
| Type of mob it will chose from the array.
|
| What type of loot you want can be expanded in a similar way to
| the mobs you want to hunt. Just add your array entry and update
| /varset LootTotal 2 to be /varset LootTotal [# of loot entries]
|
| Another thing, for the code to actualy destroy items you don't want to
| keep you must have fast item destroy turned on in the game. I would
| test the script for a while on your machine before doing this. It would
| really suck if it picks up your Eyepatch of Plunder and destroies it
| due to a bug.
#turbo 90
Sub Main
/alias /huntstats /echo Script has been running for $running seconds. You've killed @MobsKilled mobs so far and gotten @LootObtained loots!
/alias /mcords /echo $mouse(x) $mouse(y)
/declare MobToHunt global
/declare MainArray array2
/declare MyXLOC global
/declare MyYLOC global
/declare NotSee global
/declare TooFar global
/declare MyTarget global
/declare TargetDead global
/declare HasTarget global
/declare ObstCount global
/declare LootSlot global
/declare CheckLoot global
/declare LootTotal global
/declare MobArraySize global
/declare MobPriority global
/declare SpecialAttack global
/declare SelfHeal global
/declare JBootKey global
/declare EvasiveAb global
/declare DummyTime global
/declare DummyMsg global
/declare MobsKilled global
/declare LootObtained global
/declare PriorityHunting global
/declare RangeMax global
/declare RangeMin global
/declare FastRange global
/declare AntiKSMob global
/declare AntiKSMinDist global
/declare AntiKSMaxDist global
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset AntiKSMinDist 1
/varset AntiKSMaxDist 50000
/varset AntiKSMob 0
/varset RangeMax 160
/varset RangeMin 100
/varset FastRange 180
| Set this to match your JBoots hotkey.. If you don't have jboots,
| put something useful in the hotkey to be called after each fight.
/varset JBootKey 0
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Set these for when a GM comes in zone. DummyMsg is your AFK message
| and DummyTime (m for mins, s for secs) is how long you want the script
| to halt.
/varset DummyTime 15m
/varset DummyMsg "Gone to watch a movie bbl.."
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| Set this to 0 to disable prioritized hunting (random) or 1 to enable it.
/varset PriorityHunting 1
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/varset MobsKilled 0
/varset LootObtained 0
/varset LootSlot 0
/varset CheckLoot 0
/varset MainArray(1,0) "Peridot"
| Add as many of these as you want but make sure you
| increase LootTotal to match your settings above.
/varset MainArray(2,0) "Hill Giant"
| Add as many of these as you want but make sure you
| increase MobArraySize to match your settings above.
/varset LootTotal 1
/varset HasTarget 0
/varset ObstCount 0
/varset MobArraySize 1
:Start
/if n $char(hp,pct)<=70 /call EvadeDeath
/if $gm==TRUE /call DummyMode
/call GetTarget
/if @HasTarget=="1" /call MoveToMob
/if @HasTarget=="1" /call CombatSub
/if @HasTarget=="1" /call MoveToCorpse
/if @HasTarget=="1" /call LootMob
/call ResetSub
/goto :Start
/return
sub GetTarget
/if $char(buff,1)=="NULL" /call Rebuff
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=70 /call EvadeDeath
/if n $char(mana,pct)<=50 /call MedTime
/varset MobPriority 0
:Aquire
/if n $char(hp,pct)<=70 /call EvadeDeath
/if n @PriorityHunting==1 {
/target npc notid @AntiKSMob range @AntiKSMinDist @AntiKSMaxDist "@MainArray(2,@MobPriority)"
} else {
/target npc notid @AntiKSMob range @AntiKSMinDist @AntiKSMaxDist "@MainArray(2,$rand(@MobArraySize))"
}
/if n $target(id)==@AntiKSMob {
/press esc
/delay 5s
/goto :Aquire
}
/varset MyTarget $target(id)
/varset TargetDead 0
/if n $target(id)==0 {
/delay 5s
/varadd MobPriority 1
/if n @MobPriority>=@MobArraySize /varset MobPriority 0
/goto :Aquire
}
/if $target()=="False" /goto :Aquire
/varset HasTarget 1
/varset MobToHunt $target(name)
/varset AntiKSMob 0
/return
Sub MoveToMob
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=70 /call EvadeDeath
/face fast
/if n $target(distance)>=@FastRange /call Fastmove
/if n $target(distance)>@RangeMax {
/press up
}
/if n $target(distance)<@RangeMin {
/press down
}
/return
Sub Fastmove
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=70 /call EvadeDeath
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:fastmoveloop
/if $target()=="FALSE" {
/sendkey up up
/if $combat=="TRUE" {
/attack off
/return
}
}
/face fast
/if n $target(distance)>@FastRange {
/sendkey down up
}
/if n $target(distance)<=@FastRange {
/sendkey up up
/return
}
/varadd ObstCount 1
/if n @ObstCount>=3 {
/call CheckObst
}
/goto :fastmoveloop
/return
sub CombatSub
/varset AntiKSMob $target(id)
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=70 /call EvadeDeath
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/assist
/delay 2s
/if n $target(hp,pct)<=99 /call AntiKS
/if n $target(type)=="NPC" {
/goto :cleartokill
} else {
/press esc
/call AntiKS
}
:cleartokill
/if $target(type)!="NPC" {
/press esc
/call GetTarget
}
/cast "Clinging Darkness"
/delay 2s
/pet attack
:combatloop
/face fast
/call MoveToMob
/face fast
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
| CHANGE THE BELOW LINE IF YOU'RE NOT FARMING HILL GIANTS
| .... Remove the HILL portion.
/target corpse hill
/lootn never
/delay 2s
/varadd MobsKilled 1
/varset AntiKSMob 0
/varset AntiKSMinDist 1
/return
sub LootMob
/if $gm==TRUE /call DummyMode
/loot
/delay 2s
:lootloop
/if n @LootSlot>=9 /goto :doneloot
/click left corpse @LootSlot
/delay 1s
/if "$cursor()"!="TRUE" /goto :doneloot
:lootChecker
/if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" {
/delay 1s
/click left auto
/delay 1s
/varadd LootSlot 1
/varadd LootObtained 1
/goto :lootloop
}
/varadd CheckLoot 1
/if "$cursor()"=="TRUE" {
/if n @CheckLoot<@LootTotal /goto :lootchecker
}
/if "$cursor()"=="TRUE" {
/delay 1s
/click left destroy
/delay 1s
}
/varadd LootSlot 1
/varset CheckLoot 0
/goto :lootloop
:doneloot
/lootn always
/varset LootSlot 0
/return
sub ResetSub
/sendkey up up
/press esc
/press alt
/press shift
/press ctrl
/varset CheckLoot 0
/varset HasTarget 0
/varset ObstCount 0
/target pet
/if n $target(hp,pct)<=70 /cast "Touch of Death"
/delay 4s
/press esc
| /call RemoveSilvCop
/return
sub CheckObst
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObst 5
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return
sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 3s
/sendkey up down
/sendkey down Right
/delay @Param0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay @Param0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up
/return
Sub DummyMode
/echo GM IN ZONE! Pausing the script (@DummyTime)!
/afk @DummyMsg
/delay @DummyTime
/afk off
/stand
/return
Sub EvadeDeath
/echo $char(hp,pct)% health is too low: Lifetapping.
:evade
/target npc radius 300
/delay 1s
/cast "Touch of Mujaki"
/delay 1s
/cast "Touch of Mujaki"
/delay 1s
/cast "Touch of Mujaki"
/delay 1s
/cast "Touch of Mujaki"
/delay 4s
/press esc
/if n $char(hp,pct)<=70 {
/echo $char(hp,pct)% health is still too low. Lifetapping again..
/goto :evade
} else {
/stand
/echo $char(hp,pct)% health is satisfactory. Continuing the hunt!
}
/return
Sub MedTime
/echo $char(mana,pct)% mana is too low: Meditating.
:medup
/sendkey up down
/cast "Seduction of Saryrn"
/delay 1s
/cast "Seduction of Saryrn"
/delay 1s
/cast "Seduction of Saryrn"
/delay 1s
/cast "Seduction of Saryrn"
/delay 4s
/sit
/delay 60s
/if n $char(mana,pct)<=80 {
/echo $char(mana,pct)% mana is still too low. Meditating again..
/goto :medup
} else {
/stand
/delay 1s
/cast "Seduction of Saryrn"
/delay 1s
/d
/delay 1s
/d
/echo $char(mana,pct)% mana is satisfactory. Continuing the hunt!
}
/return
Sub Rebuff
/cast "Rune of Death"
/delay 1s
/cast "Rune of Death"
/delay 1s
/cast "Rune of Death"
/delay 1s
/cast "Rune of Death"
/delay 7s
/press @JBootKey
/delay 1s
/press esc
/return
Sub MoveToCorpse
/if n $target(distance)<=13 {
/return
}
/sendkey down up
:MovementLoop
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/face fast
/if n $target(distance)<=13 {
/face fast
/sendkey up up
}
/if n $target(distance)>13 /goto :MovementLoop
/return
Sub AntiKS
/assist
/delay 2s
/if $target(type)!="NPC" {
/goto :AntiKS
} else {
/echo $target(name) is not engaged. Just low on health. Engaging.
/call AttackAnyway
}
:AntiKS
/if $target(type)==corpse /return
/echo $target(name) is already engaged. Anti-KS activated.
/varset AntiKSMob $target(id)
/varset AntiKSMinDist $target(distance)
/varadd AntiKSMinDist 50
/varset HasTarget 0
/sendkey up down
/pet back off
/press esc
/delay 5s
/return
Sub AttackAnyway
/if n $char(hp,pct)<=70 /call EvadeDeath
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/pet attack
:combatloop
/face fast
/call MoveToMob
/face fast
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
| CHANGE THE BELOW LINE IF YOU'RE NOT FARMING HILL GIANTS
| .... Remove the HILL portion.
/target corpse hill
/lootn never
/delay 2s
/varadd MobsKilled 1
/varset AntiKSMob 0
/varset AntiKSMinDist 1
/return
Sub RemoveSilvCop
| /press I
| /delay 1s
|
| USE /mcords TO FIGURE OUT THE POSITION OF YOUR MOUSE OVER
| THE COPPER IN YOUR INVENTORY.
|
| /click left 862 370
| /press enter
| /delay 1s
| /mouseto destroy
| /click left
| /delay 1s
|
| USE /mcords TO FIGURE OUT THE POSITION OF YOUR MOUSE OVER
| THE SILVER IN YOUR INVENTORY.
|
| /click left 790 368
| /press enter
| /delay 1s
| /mouseto destroy
| /click left
| /delay 1s
| /press I
/return