hunter.mac simple hunt macro with loot capability.

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Fri Nov 07, 2003 11:11 am

The targeting half way accross the zone went away when Plaz, revamped /who & /Target

mekaniak
a hill giant
a hill giant
Posts: 290
Joined: Thu Sep 18, 2003 3:21 pm

Post by mekaniak » Fri Nov 07, 2003 11:14 am

I would say the ini support would be awesome with this script. You could call it by like /macro hunter "nektulos" to read the ini file to just hunt mobs in nektulos. Another thing that would be really cool with this is if you could set it up to a list of mobs to hunt at specific levels...Like decaying skeletons at lvl 1 but then once you ding 2 or 3 it will automatically switch to fire beetles. I'm not sure how hard it would be, but I know I wouldnt be able to code that. I just figured out the old code language by the time they switched it to the new one (I'm a slow learner.). But yeah, thats jujst my 2cp.
I love the Power Glove, it's so bad

Say hello to M.C. Smurf!

[quote]<mekaniak> adios guys.
<dont_know_at_all> idiot
* mekaniak is now known as mekaniak_dinner
<Jacensolo> me?
<dont_know_at_all> not this time
[/quote]

[quote]
<dont_know_at_all> A_Enchanter_00, how the fuck should i know? it's your code[/quote]

I love quoting IRC chat.

AlphaBeta
a ghoul
a ghoul
Posts: 126
Joined: Sat Nov 09, 2002 12:35 am

Post by AlphaBeta » Fri Nov 07, 2003 11:20 am

LordGiddion wrote:The targeting half way accross the zone went away when Plaz, revamped /who & /Target
When were /who and /target re-done? I really wish there were a history doc kept for MQ. :idea:

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Fri Nov 07, 2003 12:28 pm

updated about a month ago alpha

I have simular farm code in my personal.inc for genbot, but in my version I added coded that could farm based on level. IE. you set level range to 4 and the bot will farm all mobs within 4 levels of your toon. I might see about coding it for this mac and the ini stuff

honduras
orc pawn
orc pawn
Posts: 14
Joined: Sat Aug 30, 2003 5:22 pm

hey dude

Post by honduras » Fri Nov 07, 2003 3:43 pm

>Greetings Grimjack<

i meddle with the loot code a bit to make it more reliable in laggy situation.

it checks if corpse open etc and click till there is no more item left on corpse

its a bit more reliable in lag situation
/declare bobo global |sub main area

Code: Select all

sub LootMob 
 /loot  
/loot
:waitloot
   /delay 1s
   /if $corpse()!=TRUE /goto :waitloot   |funny thing why $corpse()==false dont work 
   /delay 8
:lootloop 
:wait1 
   /click left corpse @LootSlot 
   /delay 10
   /varadd bobo 1
   /if n @bobo>=8 /goto :doneloot
   /if $cursor()!=TRUE /goto :wait1
    /if $cursor()==TRUE /goto :lootChecker
:lootChecker 
   /delay 5
   /if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" { 
      /autoinv 
      /varadd LootSlot 1
      /varset bobo 0
     /if $corpse(empty)==TRUE /goto :doneloot
      /goto :lootloop 
   } 

   /if $cursor()==TRUE { 
       /click left destroy 
       /delay 5 
      /varset bobo 0
      /varadd LootSlot 1 
/if $corpse(empty)==TRUE /goto :doneloot
     /goto :lootloop 

   } 
   :doneloot 
   
   /varset LootSlot 0 
   /varset bobo 0
   /if $cursor()==TRUE /goto :lootChecker
   /click left corpse done



/return 

GeoffreyF67
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Nov 04, 2003 6:07 pm

Post by GeoffreyF67 » Fri Nov 07, 2003 4:14 pm

If you change the

/look <blah blah>

stuff to:

Code: Select all

/face loc $target(y), $target(x)
the random wandering will stop and the macro will find mobs again.

G-Man

Stogar
a lesser mummy
a lesser mummy
Posts: 58
Joined: Mon Oct 13, 2003 12:02 pm

Post by Stogar » Fri Nov 07, 2003 8:04 pm

Ok I changed this:

Code: Select all

Sub MoveToMob 
   /face loc $target(y), $target(x) 
   /if n $target(distance)>=@FastRange /call Fastmove 
   /if n $target(distance)>@RangeMax { 
      /press up 
   } 
   /if n $target(distance)<@RangeMin { 
      /press down 
   } 
/return 
and all the

Code: Select all

/face fast look nopredict
to

Code: Select all

/face fast look 

I'ts IS somewhat working again, but now the closer I get to a mob the more I look UP until i get to it then I am staring straight up. It either does that or targets something and walks off to the corner of the zone.

Been a long week I'm probably missing something simple.

Here is the whole script I am using (or not) atm:

Code: Select all

| hunter.mac 
| v2.1 
| 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. 
|
| /target id $char(pet)
|
#turbo 90 

Sub Main 
   /declare MobToHunt global 
   /declare MainArray array2 
   /declare MyXLOC global 
   /declare MyYLOC global 
   /declare KSRadius 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 RangeMax global 
   /declare RangeMin global 
   /declare FastRange global 
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset RangeMax 12 
   /varset RangeMin 12 
   /varset FastRange 12
   /varset LootSlot 0 
   /varset CheckLoot 0 
   /varset MainArray(1,0) "silk" 
   /varset MainArray(1,1) "high" 
   /varset MainArray(1,2) "pixie"
   /varset MainArray(1,3) "Greater"
| Add as many of these  as you want but make sure you 
| increase LootTotal 
   /varset MainArray(2,0) "spiderling" 
   /varset MainArray(2,1) "pixie"
   /varset MainArray(2,2) "kodiak"
   /varset MainArray(2,3) "bear" 
| Add as many of these as you want but make sure you 
|  increase MobArraySize 
   /varset LootTotal 4 
   /varset KSRadius 60 
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset MobArraySize 4 
   :Start 
   /call GetTarget 
   /if @HasTarget=="1" /call MoveToMob 
   /if @HasTarget=="1" /call CombatSub 
   /if @HasTarget=="1" /call MoveToMob 
   /if @HasTarget=="1" /call LootMob 
   /call ResetSub 
   /goto :Start 
/return 



sub GetTarget 
   :Aquire 
   /target nopcnear @KSRadius npc "@MainArray(2,$rand(@MobArraySize))" 
   /varset MyTarget $target(id) 
   /varset TargetDead 0 
   /if n $target(id)==0 /goto :Aquire 
   /if $target()=="False" /goto :Aquire 
   /varset HasTarget 1 
   /varset MobToHunt $target(name) 
/return 



Sub MoveToMob 
   /face loc $target(y), $target(x) 
   /if n $target(distance)>=@FastRange /call Fastmove 
   /if n $target(distance)>@RangeMax { 
      /press up 
   } 
   /if n $target(distance)<@RangeMin { 
      /press down 
   } 
/return 

Sub Fastmove 
   /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 look 
   /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 
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /attack on 
|Pet added
   /pet attack
   :combatloop 
   /face fast look 
   /if $char(class)==Rogue /call BackstabIt 
   /call MoveToMob 
   /face fast look 
   /if n $target(id)==0 /varset TargetDead 1 
   /if n @TargetDead!=1 /goto :combatloop 
   /sendkey up up 
   /delay 1s
   /pet follow 
   /target corpse 
   /lootn never 
   /delay 2s 
/return 

sub LootMob 
   /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 
      /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 esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset CheckLoot 0 
   /varset HasTarget 0 
   /varset ObstCount 0 
   /delay 1s 
/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 BackstabIt 
   /if n $char(ability,"Backstab")!=-2 { 
      /if $target()=="TRUE" { 
         /face fast 
         /doability "Backstab" 
      } 
   } 
/return

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Fri Nov 07, 2003 9:01 pm

Why change to:

Code: Select all

/face loc $target(y), $target(x)
The only thing that you had to do was remove the look an nopredict since they are now the default.

Code: Select all

/face fast look nopredict
becomes

Code: Select all

/face fast

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update:

Post by grimjack » Fri Nov 07, 2003 9:07 pm

Hunter.mac:
Updated to remove all nopredict and look references. They are now the default and the flags where removed.
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

GeoffreyF67
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Nov 04, 2003 6:07 pm

Post by GeoffreyF67 » Sat Nov 08, 2003 12:29 am

grimjack wrote:Why change to:

Code: Select all

/face loc $target(y), $target(x)
The only thing that you had to do was remove the look an nopredict since they are now the default.

Code: Select all

/face fast look nopredict
becomes

Code: Select all

/face fast

Thanks
I tried that but the macro still wandered aimlessly about east karana...I've got the latest build. Am I the only one having the problem when it's /face fast?

Also, the looting code isn't working for me. Still trying to figure that one out...

tac8357
orc pawn
orc pawn
Posts: 25
Joined: Fri Oct 17, 2003 5:18 pm
Contact:

Same Problem

Post by tac8357 » Sat Nov 08, 2003 10:03 am

Yep still appears to be broken..

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Sat Nov 08, 2003 4:57 pm

I managed to get it working by simply removing all the instances of (distance,nopredict) and /face fast look nopredict.


Just change it to (distance) and /face.

jon5137
orc pawn
orc pawn
Posts: 12
Joined: Mon Nov 17, 2003 2:09 pm

Post by jon5137 » Mon Nov 17, 2003 8:59 pm

How can I mod this to run to the mob stop at a certain distance then cast a spell (IE like slow) and pull it back to a safe spot where and kill it there where I have my druid that I use for heals. This way I dont just run all over the place. Maybe I can do this with some of the genbot code? I am still new to genbot but if anyone could point me in the right direction that would be great.

Drunkensloth
a lesser mummy
a lesser mummy
Posts: 67
Joined: Sat Oct 18, 2003 2:54 am

Post by Drunkensloth » Wed Nov 19, 2003 11:35 pm

make an anchor....

get spellcasting ini and cast whatever spell you want when distance from NPC is what you want..

/face anchor
autorun

when distance from anchor is what you want, autofight or whatever...
And here I was clicking like a sucker!

wrangler
a ghoul
a ghoul
Posts: 93
Joined: Fri Nov 28, 2003 3:07 pm

Post by wrangler » Fri Nov 28, 2003 3:12 pm

the macro is working great for me under latest MQ2 build but, i have a major problem

it makes me run in straight line to where it 1st picked up the next mob, i have to "steer" my toon to where mob is running to

once im in melee range, everything works fine, but like i said, that next target it picks up, it doesnt wanna make me "track" to it, but merely to where it picked it up at


thanks for any assistance


** after some more trials, i found out that if targetted mob is stationary, it has no problem , and will even follow mob if it start to flee.