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

Axo959
orc pawn
orc pawn
Posts: 12
Joined: Wed Jul 21, 2004 10:35 am
Location: Seattle

Hunter question

Post by Axo959 » Thu Jul 29, 2004 11:18 am

Thanks Rob et all for a great macro. I've used it and it works great, watching a toon run around and kill things on its own is a thing of beauty. I had a question about a small issue I have experienced though.

Currently I use it to hunt newb mobs in ShadeWeaver's with a high lvl DS on. If the low lvl mob dies from the DS and life goes to 0%, the auto attack stays on. If I manually turn off auto attack, I get the text message auto attack is off, but the flashing red around my name remains as well as the 'attack' music.

What I've found is if I manually right click on the mob, then hit done, the auto attack will turn off. Then the macro will resume, it will then loot the mob and properly loot items in the loot table, and dispose of things that are not. Then it runs paranoid with a random delay and continue on its merry way slaying mobs.

So to me it seems like the code works great as is. I'm just not sure why its hanging when the DS *i think* gets the kill. Beings these are really low lvl mobs, the DS kills them in about two hits, so maybe the life=0% too quickly for the macro to recognize its dead or? The target remains, albiet a corpse.

Any suggestion appreciated, thanks again.

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Thu Jul 29, 2004 3:55 pm

I haven't looked too much at the macro (I just use it a lot), but my guess is that it waits for a "mob has been slain" message, rather than monitoring hps. You may want to see what type of message is generated, and modify the event based on that.

Or not. Just an idea

Axo959
orc pawn
orc pawn
Posts: 12
Joined: Wed Jul 21, 2004 10:35 am
Location: Seattle

/shrug

Post by Axo959 » Thu Jul 29, 2004 5:49 pm

Sub CombatSub

/echo Attacking Mob NOW!
/varset RV_Fighting 1
/varset RV_TargetDead 0

:CombatLoop
/doevents
/attack on

/call MoveToMob
/call SpecialIT

/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back

/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
/target radius 30 corpse
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}

/return
I'm brand new to scripting. I believe I've followed the codes flow and wound up here where it is deciding if a mob is dead or not. I dont think its parsing for a text string like "mob has been slain by x" but I'm not sure.

I think it turns on autoattack, then calls movetomob sub to stick on mob while fighting in case it runs. Then it does the following..

/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back

I believe this is to see if your target is <null>? I dunno, will have to check readme tonite at home. I need to find out if "/if (!${Target.ID})" means null or what. Then it turns off autoattack, sets dead variable to true and attack variable to false? I think...

Thanks for any input.

missingfiles
a hill giant
a hill giant
Posts: 224
Joined: Wed Jun 09, 2004 1:15 pm

Post by missingfiles » Thu Jul 29, 2004 5:52 pm

It will return the value Null

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Thu Jul 29, 2004 7:43 pm

I'm at work, so didn't have any time to look at the script, but you're right. It doesn't wait for the message.. it waits for the mob to no longer be targeted... in which case, it shouldn't matter what kills him.

The /forward, /backward commands are to fix a bug some people had with looting the corpse.. if I remember correctly.

My next step if I were you would be to add some /echo's around that piece of code, to try to trace it.

If that's the code to turn autoattack off, and autoattack's not turning off, there's a good chance that the piece of code is getting skipped. Again, I haven't even looked at the code, so I could be wrong. I'm just telling you what I'd do if it wasn't working and I wanted to know why.

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

Post by Thornado » Fri Jul 30, 2004 2:20 am

Ok rather then seeing a bunch of peps blindly trying stuff I will explain whats wrong. Not how to fix it mind you :lol: I don't have the time anytime soon to even try.

Whats happening is when your fighting a mob and it dies you will notice that you will not have anything targeted. Thats why it checks for NULL. Trying hitting esc during a fight while running this macro and watch what happens you will see what I am talking about in action. When you have a DS the mob is hitting you which is causing his death and if you watch the hit message often seems to show up after the death message/[and a exp message when fighting a higher level mob]. When you get it without a target the game will target that mob problem is its dead so it targets the corpse. The problem is the macro never saw the target cleared and it just sits there. If you wait long enough and the corpse rots it will pick back up or you can hit esc for now.

I really am starting to like that idea of using a event to pick up the death of the mob they are not too bad to do just have to watch it becase of the possibility of adds that died to your DS screwing it up.

Axo959
orc pawn
orc pawn
Posts: 12
Joined: Wed Jul 21, 2004 10:35 am
Location: Seattle

nail, head

Post by Axo959 » Fri Jul 30, 2004 10:09 am

Thornado-

That's exactly what is happening. I wasnt sure why the corpse was my target after it was dieing, but it is because i am getting a 'x mob hits you for x dmg' message after the mob is dead, so i instantly get the corpse as a target, thus the value is not null. In the code I see the goto at the bottom will make it go back to the combat loop if the value is not null. So its stuck in a loop.

I know the code is fine, because i ran it in EK with a higher lvl toon farming some silks. I didnt use a DS and it worked perfect. So I knew it had to be something to do with PL'ing a low lvl toon since I was using a DS. I just wasnt catching the last ditch effort hit of the mob as the cause.

I wouldnt know what to do off the top of my head that would be the most elegant solution in all situations. (mainly adds that would die off from DS at this low of a lvl, thus looking for death messge may not be best)

It doesnt matter a whole lot as I wont be PLing that long wih a DS anyway. Alhough I do PL a lot of toons, so if I think of some solution I'll give it a go and post the code here for ppl to use.

Thanks

SirTwist
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sat Jul 31, 2004 11:07 pm

Post by SirTwist » Sun Aug 01, 2004 9:08 am

In reguards to the damage shield kills, you can simply add this to the end of the Sub SpecialIt section:


/if (${Target.Name.Find["'s_corpse"]}) {
echo Possible Damage Shield Kill - Dropping Target
/keypress ESC
}

That will make the last possible thing you do in the attack section check to see if you have something's corpse targeted, if so - then drop that target. When it hits the /return the very next thing it will do is check to see if you have a target to see if you've killed the mob. Since this removed your target - it will go right into looting.

stinger520
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jul 01, 2004 4:06 pm

problem looting corpse

Post by stinger520 » Mon Aug 02, 2004 10:10 am

any one else having a problem after u kill the mob with it looting. Loads zone/loot info fine, finds the mob, goes to it, kills it all fine, but after it gets killed it moves sideways "obstacle hit, moving around it"

any one else having a problem here, going to try and look more closely at the code tonight to figure it out

stinger520
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jul 01, 2004 4:06 pm

problem looting corpse

Post by stinger520 » Mon Aug 02, 2004 10:11 am

any one else having a problem after u kill the mob with it looting. Loads zone/loot info fine, finds the mob, goes to it, kills it all fine, but after it gets killed it moves sideways "obstacle hit, moving around it"

any one else having a problem here, going to try and look more closely at the code tonight to figure it out

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Mon Aug 02, 2004 11:23 am

In your setup, declare a TempTarget variable.

Code: Select all

Sub CombatSub

/echo Attacking Mob NOW!
/varset RV_Fighting 1
/varset RV_TargetDead 0
/varset TempTarget ${Target.Name}

:CombatLoop
/doevents
/attack on

/call MoveToMob
/call SpecialIT

/if (${Target.Name.NotEqual[${TempTarget}]}) {
/attack off
/keypress forward
/keypress back

/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
/target radius 30 corpse
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}

/return
That should take care of the attacking corpses issue. The change was to set a temptarget variable equal to the target's name then, instead of checking to see if there's no target, it checks against the target's name. Unfortunately, this makes switching targets during combat somewhat rough, but it doesn't look like that's something that's handled from this snippet.

wardave
a ghoul
a ghoul
Posts: 120
Joined: Sun Jan 25, 2004 4:38 am

Post by wardave » Tue Aug 03, 2004 2:59 pm

Somethings wrong in the Movement part of the mac.

Unparsable in Calculation: "l"
hunter.mac@183 (MoveToMob): /if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<100)) {

hunter.mac@92 (Main): /if ($(RV_HasTarget}) /call MoveToMob

The current macro has ended
Failed to parse /if condition '((!0)&&(!0)&&(100))'. non-numeric encountered

I think its the &lt but I dont know how to replace that bit of code to fix it.

EDIT

I think I found the answer

Posted: Wed Jun 30, 2004 6:28 am Post subject: bbcode fubar

--------------------------------------------------------------------------------

The brackets are fubared for old posts.

You must change < to < and > to >.

New posts seem fine. I believe that the previous incarnation of phpBB2 was hacked to display the wrong way.

No, I'm not going to fix it. We have to move forward with the phpBB2 code to close up security holes that some assholes keep trying to exploit and I don't want to patch it for every freaking update.


Now to put two and two togeather :)

wardave
a ghoul
a ghoul
Posts: 120
Joined: Sun Jan 25, 2004 4:38 am

Post by wardave » Tue Aug 03, 2004 3:27 pm

Cool it works now. Maybe someone should repost it with the fixes in it?

hed
decaying skeleton
decaying skeleton
Posts: 1
Joined: Thu Aug 05, 2004 12:23 pm

Post by hed » Thu Aug 05, 2004 12:27 pm

i got this macro working just fine.... but the killadds part doesn't seem to do anything.

I'm not getting any errors, but if i get an add, the macro just ignores it and keeps going around finding mobs in my moblist while the add beats me to death (allbeit very slowly)... kind of a pain in zones with skeletons in them, as they agro on anyone regardless of level

Chant3r
orc pawn
orc pawn
Posts: 10
Joined: Sun Apr 18, 2004 3:27 pm

Post by Chant3r » Sat Aug 07, 2004 11:24 am

I don't know code but this is what I am getting when I try to use Hunter.mac

Logging to 'eqlog.txt' is now *ON*.
[MQ2] Attempting to Read Section "Toxxulia Forest" Zone Information from HunterMob.ini...
[MQ2] Declaring Mob Array...
[MQ2] "Toxxulia Forest" Zone Information Read Successfully from HunterMob.ini...
[MQ2] Attempting to Read Section "Toxxulia Forest" Zone Information from HunterLoot.ini...
[MQ2] Declaring Loot Array...
[MQ2] "Toxxulia Forest" Zone Information Read Successfully from HunterLoot.ini...
[MQ2] Acquired an infected rat at range 169
Unparsable in Calculation: 'l'
hunter.mac@183 (MoveToMob): /if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<100)) {
hunter.mac@92 (Main): /if (${RV_HasTarget}) /call MoveToMob
The current macro has ended.
Failed to parse /if condition '((!0)&&(!0)&&(100<100))', non-numeric encountered
Chant3r

If I were you I would hate me too