Code: Select all
[color=orange]wizhunter.mac
|version 0.3
|
| Wizard farming macro by: Drunkensloth
|
| Credits:
| Necrofied by: Elretardo
| Original Script by grimjack
| New Anti-KS concept by switch, created by elretardo
| Prioritized hunting enhancement by theafkxper
|WIzard notes:
|revision history: fixed lots of random stuff the first couple times
|-fixed sitting and swimming still need this tested~ will post tonight.
|--still to do: fix med loop to kill anything that attacks you while medding
|-fix rebuff so that it actually recasts after it fades, something wrong with the placement of doevents
|-rework the casting section to farm mobs that require more than one nuke and such
|-test out what happens with an add and retest all the different subs with these revisions
|-still cant handle adds properly...
|-does not move around obstruction when doing loot section... needs fix
|
| 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
#include SPELLCAST.inc
#Event rune "The maelstrom dissipates"
#Event fami "Your familiar departs"
#Event slain "You have been slain by"
#Event lev "You return to the ground"
#Event hits "tries to hit YOU"
|you need to have epic rune, okeils levity, and familiar cast BEFORE you start or they wont recast~
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 epicKey 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
/declare rootnuke global
/varset rootnuke 1
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset AntiKSMinDist 1
/varset AntiKSMaxDist 50000
/varset AntiKSMob 0
/varset RangeMax 50
/varset RangeMin 30
/varset FastRange 200
| 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 1
/varset epicKey 2
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| 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 10m
/varset DummyMsg "laundry time!"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 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) "Wailing"
/varset MainArray(1,1) "Perfect"
/varset MainArray(1,2) "Owlbear Feather"
/varset MainArray(1,3) "Shrieking"
/varset MainArray(1,4) "quality"
| Add as many of these as you want but make sure you
| increase LootTotal to match your settings above.
/varset MainArray(2,0) "owlbear"
/varset MainArray(2,1) "sonic"
/varset MainArray(2,2) "rockhopper"
| Add as many of these as you want but make sure you
| increase MobArraySize to match your settings above.
/varset LootTotal 5
/varset HasTarget 0
/varset ObstCount 0
/varset MobArraySize 3
:Start
/if n $char(hp,pct)<=40 /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
/press @JBootKey
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=40 /call EvadeDeath
/if n $char(mana,pct)<=50 /call MedTime
/varset MobPriority 0
:Aquire
/if n $char(hp,pct)<=40 /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)<=40 /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)<=40 /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
|-------------------------Wizarded~~~~~~~~~~~~~~Untested~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub CombatSub
/varset AntiKSMob $target(id)
/if $gm==TRUE /call DummyMode
/if n $char(hp,pct)<=40 /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
}
:combatloop
/face fast
/call MoveToMob
/face fast
/delay 1s
/if $char(state)=="SIT" /stand
/if $char(swimming)==5 /call HitObst
/if n @rootnuke==1 {
/call Cast "Greater Fetter"
/varset rootnuke 2
} else {
/delay 1s
/call Cast "Draught of Ro"
}
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
/target corpse
/lootn never
/delay 2s
/varset rootnuke 1
/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
| /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
|-------------------------Wizarded~~~~~~~~~~~~~~~~~~~~~~Untested~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub EvadeDeath
|this will succor (change /press to your succor hotkey)
/echo $char(hp,pct)% health is too low: Lifetapping.
/press 8
/delay 2s
/press 8
:heal
/if n $char(hp,pct)<=95 {
/echo $char(hp,pct)% health is still too low. Regenning HP
/if $char(state)=="SIT" /stand
/delay 60s
/goto :heal
} else {
/stand
/echo $char(hp,pct)% health is satisfactory. Continuing the hunt!
}
/return
Sub MedTime
/echo $char(mana,pct)% mana is too low: Meditating.
/press 7
/doevents
/if $char(state)=="SIT" /stand
/press 7
:Waithod
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :waithod
}
/press @epicKey
:Waitepic
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :Waitepic
}
/call Cast "Harvest"
:Waitharvest
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :Waitharvest
/delay 11s
}
:medup
/doevents
/delay 1s
/if $char(state)=="STAND" /sit
/delay 7s
/if n $char(mana,pct)<=90 {
/echo $char(mana,pct)% mana is still too low. Meditating again..
/goto :medup
} else {
/sit off
/echo $char(mana,pct)% mana is satisfactory. Continuing the hunt!
}
/return
|-------------------------Wizarded~~~~~~~~~~~~~~Untested~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_rune
/press @epicKey
:Waitepic
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :Waitepic
}
/delay 1s
/press esc
/return
|-------------------------Wizarded~~~~~~~~~~~~~~Untested~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_fami
/doevents
/press 6
|allegiant familiar hotkey change ot match your own)
:Waitfam
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :Waitfam
}
/delay 1s
/pet get lost
/press esc
/return
Sub Event_lev
/call Cast "O`keils Levity"
/delay 1s
/return
Sub Event_hits
/call kill
/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(name)=="$char(name)" /call kill
/if $target(type)!="NPC" {
/goto :AntiKS
}
: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 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
Sub kill
:combatloop
/face fast
/call MoveToMob
/face fast
/delay 1s
/if $char(ismoving)==true {
/sit
/delay 1s
/sit off
}
/if $char(swimming)==5 /call HitObst
/if n @rootnuke==1 {
/call Cast "Greater Fetter"
/varset rootnuke 2
} else {
/delay 1s
/call Cast "Draught of Ro"
}
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
/target corpse
/lootn never
/delay 2s
/varset rootnuke 1
/varadd MobsKilled 1
/varset AntiKSMob 0
/varset AntiKSMinDist 1
/return
Sub Event_slain
/delay 2m
/if $char(state)=="SIT" /stand
/camp
/end
/return[/color][code][/code]


