Hunter Macro (v1.3 UPDATED 06-07-2004 12:51pm PST)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

apollo5145
orc pawn
orc pawn
Posts: 26
Joined: Wed Feb 25, 2004 8:14 pm

Post by apollo5145 » Fri May 14, 2004 7:23 pm

I just tried it out, great macro but it seems to ignore the max radius. It was running to any range when i set it to 100. I quickfixed it and made it /return if target.distance was too high though. Might wanna look into this. Gonna work on it a bit more later and add a few features.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Sat May 15, 2004 12:37 am

I made some modifications to your code, mainly oriented to using a necro to farm instead of a melee.

One of the big changes you may be interested in is a "body cleanup" that will try to find any unlooted corpses after all mobs are cleared. I also adapted the goto mob code a tad to be more effecient and support a "stay away" type zone with a configurable fuzzyness. If you like, I would be happy to post your code I modified :)

Glasscoin
a lesser mummy
a lesser mummy
Posts: 55
Joined: Mon Jan 13, 2003 8:57 am

Post by Glasscoin » Sat May 15, 2004 1:21 am

First of all, thanks for sharing this wonderful macro! I've adapted it for my own purposes, and it works beautifully.

There's one problem I've run into, however. With the KillAdds code, if you're attacked by a mob that's not at full health, it will detarget it, then target it, then detarget it... forever.

The problem occurs because the MoveToMob sub has a check for HP -- if your target's HP isn't equal to 100%, it'll go into the loop. For anybody with innate DS item like Talisman of Vah Kerrath, or if the mob that's attacking you isn't at full HP for any other reason (such as another mob in the zone attacking it, it casting a HP buff on itself, whatever), this presents a problem.

I have a solution, but I'm not sure if it's the best way of doing it... seems to be working, though. I'll post it tomorrow if I'm sure it's working nicely and anyone else here has the same problem.

Glasscoin
a lesser mummy
a lesser mummy
Posts: 55
Joined: Mon Jan 13, 2003 8:57 am

Post by Glasscoin » Sat May 15, 2004 3:11 pm

Also, for anyone who wanted a priority type thing, so that your first preference for kill is Mob 1, if there are no Mob_1s, then kill Mob_2, if there are no Mob_2s, kill Mob_3... etc... it's really a very simple change.

Original code:

Code: Select all

/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100 
      /for RV_TargetSub 1 to ${RV_MobArray.Size} 
         /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}" 
         /varset RV_MyTargetID ${Target.ID} 
         /varset RV_MyTargetDead 0 
         /if (${Target.ID}) { 
            /if (${Int[${Target.PctHPs}]}<100) { 
               /echo Mob NOT a Full Health, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
               /echo Mob is BELOW Min Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
               /echo Mob is ABOVE Max Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /varset RV_HasTarget 1 
            /varset RV_MyTargetName ${Target.Name} 
            /echo Acquired ${Target.Name} at range ${Int[${Target.Distance}]} 
            /return 
         } 
      /next RV_TargetSub 
      /delay 2 
   /next RV_CurrentRadius
All you have to do is have the radius loop inside of the target sub loop, instead of vice versa.

Code: Select all

   /for RV_TargetSub 1 to ${RV_MobArray.Size} 
      /for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100    
         /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}" 
         /varset RV_MyTargetID ${Target.ID} 
         /varset RV_MyTargetDead 0 
         /if (${Target.ID}) { 
            /if ((${Int[${Target.PctHPs}]}<100)&&(!${RV_HurtTarget})) { 
               /echo Mob NOT a Full Health, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
               /echo Mob is BELOW Min Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
               /echo Mob is ABOVE Max Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /varset RV_HasTarget 1 
            /varset RV_MyTargetName ${Target.Name} 
            /echo Acquired ${Target.Name} at range ${Int[${Target.Distance}]} 
            /return 
         } 
      /next RV_CurrentRadius 
      /delay 2 
   /next RV_TargetSub 
Using this code, it will first try to kill any and all mobs that are first listed in your *.ini file -- if none of them are up, if will then target the next type of mob specified in your ini. So with an ini file like this:

[Eastern Plains of Karana]
Mob1=spider
Mob2=lion

It would first kill all spiders in the zone, and if none of them are up, will then start killing lions.[/code]

DumbStruck
a ghoul
a ghoul
Posts: 125
Joined: Fri Apr 30, 2004 8:46 am

Very nicely done!

Post by DumbStruck » Sun May 16, 2004 2:21 am

Hats off to both of you very nice macro .. I only have one request .. Please enlighten me as to where i can put a gate command i often farm in hollowsahde moor and get caught up on the stilt houses. I have tried to place a gate cmd where it counts the checkobstacle but doesnt work i dont think that count is working right ..

Code: Select all

/if (${RV_ObstacleCount}>=15) {
      /call CheckObstacle 
      /goto :Movementloop 
   }

It tends to try and gate as soon as an obstacle is hit .. i have placed my gate cmd right before /goto :movementloop

I believe its supposed to try and switch target after 15 tries to move but it doesnt do that .. i also tried to plug in the /rewind cmd but again that goes at 1st obsacle.

Amoro
decaying skeleton
decaying skeleton
Posts: 3
Joined: Tue May 11, 2004 3:10 pm

Post by Amoro » Sun May 16, 2004 9:51 am

Fryfrog I'd be interested in seeing your modified code. Also, i'm trying to figure out how to modify the code to pull with a clicky. Could anyone help?

Stilgar
a lesser mummy
a lesser mummy
Posts: 44
Joined: Thu Oct 23, 2003 9:43 pm

error

Post by Stilgar » Sun May 16, 2004 1:08 pm

/declare 'LootSlot' failed. Name already in use
hunter.mac@248 (LootMob)
hunter.mac@93 (Main)
/declare 'LootTotal' failed. Name already in use
hunter.mac@250 (LootMob)
hunter.mac@93 (Main)
/for loops must use an int variable
Hunter.mac@268 (LootMob)
Hunter.mac@93 (Main)

is what I encountered trying to loot first mob...what to change?

Line 93:
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob

Line 248:
/declare LootSlot int inner 0

Line 250:
/declare LootTotal int inner 0

Line 268:
/for LootSlot 1 to ${LootTotal}

Thornado
orc pawn
orc pawn
Posts: 16
Joined: Wed May 12, 2004 6:59 pm

Simple add fix for people with a DS

Post by Thornado » Sun May 16, 2004 4:57 pm

The fix so that if you get an add and are going into loops because you have a DS is easy. Whats happening is that the movetomob sub has a check if the mob is not at full health and you don't have a combat variable set it kicks the mob out problem is a DS will make sure that mob is not full health. All you need to do is put the original movetomob call before the :KillAdds label. Or just look below :P

Code: Select all

   /call GetTarget 
[color=red]   /if (${RV_HasTarget}) /call MoveToMob [/color]

   :KillAdds 
   /if (${RV_HasTarget}) /call CombatSub 
   /if (${RV_HasTarget}) /call MoveToMob 
   /if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob 
   /call ResetSub 
In the end this actually will only effect mobs that are damaged and that have attacked you. The macro will still have the anti KS code in movetomob running yet does not check that KS code when you get an add. Also good if you get trained because the mobs might not be at full health in that case as well.

Glasscoin
a lesser mummy
a lesser mummy
Posts: 55
Joined: Mon Jan 13, 2003 8:57 am

Post by Glasscoin » Mon May 17, 2004 2:47 am

Thanks a lot, Thornado. Wish I would have thought of that -- works very well. :D

MoonRaverX
a ghoul
a ghoul
Posts: 91
Joined: Tue Dec 16, 2003 5:09 pm
Location: Tampa, Fl

Post by MoonRaverX » Tue May 18, 2004 3:26 am

I absolutely love this one. First off, ignore what people are saying about adding in spells and whatnot. If anything, a VERY VERY generic call and return to an empty function for after fight, and start of fight... but DON"T add the commands to do whatever, unless it's a very generic one. Reason being, it's a GREAT learning and jumping point, simple enough to get the job done, and those that want to do more can learn a bit of macro programming as well. I added in pulling with burst of flame and keeping sow via a clicky and haste via a spell. It's not hard.

Grats and a sincere thank you.

Edit... the one thing i can't find is sometimes right after I kill my target, I get these errors (line numbers from stock...)
all in a row...
There were no matches for (0-100) any
hunter.mac @ 187 (MovetoMob):/face fast
hunter.mac @ 219 (CombatSub):/call MoveToMob
hunter.mac @ 91 (Main):/if (${RV_HasTarget}) /call CombatSub

and then it continues normal....

Just an observation, and I haven't found the fix yet myself. It doesn't seem to do any bad things, just annoying.
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

Jones
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun May 16, 2004 1:33 am

Post by Jones » Tue May 18, 2004 11:19 am

Bleh posted asking how to add in /rewind function but shoulda realised it was as simple as adding it into the obstavoid code befopre the return :P

robdawg
a ghoul
a ghoul
Posts: 114
Joined: Tue Mar 23, 2004 11:54 am
Contact:

Post by robdawg » Tue May 18, 2004 12:05 pm

MoonRaverX wrote:There were no matches for (0-100) any
hunter.mac @ 187 (MovetoMob):/face fast
hunter.mac @ 219 (CombatSub):/call MoveToMob
hunter.mac @ 91 (Main):/if (${RV_HasTarget}) /call CombatSub
Yeah I couldn't figure this one out. Kinda of a wierd thing that it appears 1 out of 5 mobs and then like you said just continues as normal.

I should have an update here soon. Hopefully tonight or tomorrow. Depends on how much velium farming I do tonight. :)
ROBDAWG

[url=http://www.seathound.com]Seat Hound[/url]
[url=http://www.sportsrumormill.com]Sports Rumor Mill[/url]
[url=http://www.packerforum.com]Packer Forum[/url]

Jones
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun May 16, 2004 1:33 am

Post by Jones » Tue May 18, 2004 12:20 pm

If you can rob head on over to hollowshade and waste the south camp..you will see a few quirks in the obst avoid code maybe you can help fix that :) im trying on my own but sometimes i get hopelessly stuck and have to end macro to move off it.

DumbStruck
a ghoul
a ghoul
Posts: 125
Joined: Fri Apr 30, 2004 8:46 am

Post by DumbStruck » Tue May 18, 2004 12:39 pm

JONES WROTE:
If you can rob head on over to hollowshade and waste the south camp..you will see a few quirks in the obst avoid code maybe you can help fix that im trying on my own but sometimes i get hopelessly stuck and have to end macro to move off it.
hehe grr silly me .. i did this other night ended up in a death loop lost 4 yellows and couldnt wear 1/2 my gear hehe .. Thank goodenss for ele flags ..

i have added the rewind in the loop here but it just spam's cant do it yet or what ever. i also tried adding in a cast dmf event think thats what got me killed it was holding me as target and wouldn't release .. I love this macro just very new at this and trying to figure out the coding. one thing that i wanted to do for hollow shade was have it gate after the 5th hit this obstacle thing. as i kept getting stuck in the houses .. (hence the death loop) .. i have since added event for ending macro and camping if death occurs

Mister Peepers
a lesser mummy
a lesser mummy
Posts: 46
Joined: Mon Apr 19, 2004 8:10 pm

Post by Mister Peepers » Tue May 18, 2004 2:57 pm

MoonRaverX wrote:There were no matches for (0-100) any
hunter.mac @ 187 (MovetoMob):/face fast
hunter.mac @ 219 (CombatSub):/call MoveToMob
hunter.mac @ 91 (Main):/if (${RV_HasTarget}) /call CombatSub
All thats happening is your geting an error because the macro after it kills the mob its attack it trys to do the /face fast command and since there is no target it can't face anything. I haven't figured out how to stop this my self but slowly got away from the main function in my own hunter macro:
What I did find usefull is puting the call to the loot sub as part of the combat macro and then for adds puting that right after the call to the loot macro. I will PM you with the details if you want. If I figure out how to get rid of the error above I will post about it.