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

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

Post by weapon » Mon Oct 20, 2003 10:59 am

Ehh screw it the comments should tell ya the extra logic. Ran this for an hour without problems. Take what ya want leave the rest for the dogs.

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.


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 AttackRange global
   /declare MobArraySize global
   /declare WaitForAdds global
   /press esc
   /press esc
   /press esc
   /press esc
   /press alt
   /press shift
   /press ctrl
   /varset RangeMax 12
   /varset RangeMin 10
   /varset AttackRange 15
   /varset LootSlot 0
   /varset CheckLoot 0
   /varset KSRadius 60
   /varset HasTarget 0
   /varset ObstCount 0
   /varset WaitForAdds 1
| Add as many of these as you want but make sure you increase LootTotal
   /varset LootTotal 2
   /varset MainArray(1,0) "silk"
   /varset MainArray(1,1) "quality"
| Add as many of these as you want but make sure you increase MobArraySize
   /varset MobArraySize 12
   /varset MainArray(2,0) "griffawn"
   /varset MainArray(2,1) "wolf"
   /varset MainArray(2,2) "lioness"
   /varset MainArray(2,3) "stalker"
   /varset MainArray(2,4) "lion"
   /varset MainArray(2,5) "hound"
   /varset MainArray(2,6) "gnoll"
   /varset MainArray(2,7) "reaver"
   /varset MainArray(2,8) "werewolf"
   /varset MainArray(2,9) "spiderling"
   /varset MainArray(2,10) "bear"
   /varset MainArray(2,11) "kodiak"

   :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
   /declare MobNumber local
   /declare NumberOfMobsFound local
   /declare CurrentMobToCheck local
   /declare ClosestMob local

   /varset TargetDead 0

   :Aquire

   |Wait 3 seconds to see if you have an add on you
   /if @WaitForAdds==1 {
      /delay 3s
      /if n $target(id)!=0 /goto  :HaveMob
      /if $target()!="False" /goto  :HaveMob
   }

   |Check if your pet is attacking anything
   /if $char(pet)!=0 {
       /target id $char(pet)
       /assist %t
       /if n $target(id)==$char(pet) /goto  :PetDoesntHaveTarget
       /if n $target(hp,cur)<1 /goto :PetDoesntHaveTarget
   }

   |Loop through the mob list and get the distance of every mob
   :PetDoesntHaveTarget

   /varset MobNumber "0"
   /varset NumberOfMobsFound 0

   :MobListCycle
       /target nopcnear @KSRadius npc "@MainArray(2,@MobNumber)"
       /if $target()!="False" {
          /varset MainArray(3,@NumberOfMobsFound) $target(id)
          /varadd NumberOfMobsFound 1
       }
       /varadd MobNumber 1
       /if n @MobNumber==@MobArraySize /goto :DoneMobListCycle
       /goto :MobListCycle
   :DoneMobListCycle

   |Do a check to see which mob in the mobs list is the closest
   /varset CurrentMobToCheck 0
   /varset ClosestMob 0

   :MobListClosest
       /if n $spawn(@MainArray(3,@CurrentMobToCheck),distance)<$spawn(@MainArray(3,@ClosestMob),distance) {
          /varset ClosestMob @CurrentMobToCheck
       }
       /varadd CurrentMobToCheck 1
       /if n @CurrentMobToCheck==@NumberOfMobsFound /goto :DoneMobListClosest
       /goto :MobListClosest
   :DoneMobListClosest

   /target id @MainArray(3,@ClosestMob)
   /varset MyTarget $target(id)

   /if n $target(id)==0 /goto :Aquire
   /if $target()=="False" /goto :Aquire

   :HaveMob
   /varset HasTarget 1
   /varset MobToHunt $target(name)
/return

sub MoveToMob
   /if n $target(distance)<=@AttackRange {
      /face fast look nopredict
      /return
   }
   /sendkey down up
   :Movementloop
       /delay .5s
       /varset MyXLoc $char(x)
       /varset MyYLoc $char(y)
       /varadd ObstCount 1
       /if $target()=="FALSE" {
          /varset HasTarget 0
          /return
       }
       /face fast look nopredict
       /if n $target(distance)<=@AttackRange {
          /face fast look nopredict
          /sendkey up up
          /return
       }
       /if @ObstCount>=3 {
          /call CheckObst
          /goto :Movementloop
       }
   /if n $target(distance)>@AttackRange /goto :MovementLoop
   /doability "sneak"
/return

Sub CombatSub
   /if $target()=="FALSE" {
      /varset HasTarget 0
      /return
   }
   :CombatLoop
      /attack on
      :CombatMove
         /delay .5s
         /varset MyXLoc $char(x)
         /varset MyYLoc $char(y)
         |Check if we still have target to chase
         /if n $target(id)==0 /goto :WeKilledIt
         |Check if we are in range
         /if n $target(distance)>=@AttackRange {
           /face fast look nopredict
           /sendkey down up
           /goto :CombatMove
         }

         /varadd ObstCount 1

         /face fast look nopredict
         /if n $target(distance)<=@AttackRange {
           /face fast look nopredict
           /sendkey up up
           /goto :InAttackRange
         }
         /if @ObstCount>=3 {
           /call CheckObst
           /goto :CombatMove
         }
      /if n $target(distance)>@AttackRange /goto :CombatMove
      :InAttackRange
   /if n @TargetDead!=1 /goto :CombatLoop
   
   :WeKilledIt
   /sendkey up up
/return

Sub LootMob
   /varset LootSlot 0
   /delay 1s
   /target corpse
   /delay 1s
   /loot
   |Wait for loot window to come up
   /delay 2s

   :lootloop
       /lootn never
       /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
/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 nopredict
         /doability "Backstab"
      }
   }
/return

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

Post by grimjack » Mon Oct 20, 2003 11:08 am

Updated the var problem good catch. I like your version better. You should post it under it's own thread too. Just don't forget to turn off smilies hehe.
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

Tuffy
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Oct 02, 2003 9:20 am

Post by Tuffy » Mon Oct 20, 2003 4:24 pm

Ok, by setting AttackRange to 15. Will this keep you at distance of 15 from mob? If so, could I just change this to say 50 and add some pet commands to make in pet caster friendly?

Code: Select all

  /varset RangeMax 52 
   /varset RangeMin 45 
   /varset AttackRange 50 

Code: Select all

| spell names 
   /declare SelfShieldSpell      "Major Shielding" 
   /declare PetBuffSpell      "Intensify Death" 
   /declare PetHealSpell      "Renew Bones" 
Under :Start

Code: Select all

/call CastSpells 

Code: Select all

Sub CastSpells 
:StartSpells 

   | see if we have mana to spare 
   /if n $char(mana,pct)<20 /goto :SkipSpells 
    
   | decide which spell to cast 
   /if   n $char(buff,"SelfShieldSpell")==0 { 
      
      /delay $int($calc($spell("@SelfShieldSpell",casttime)*10+5)) 
      /goto :StartSpells 
   } 
    
   | check to see if we have a pet up 
   /if n $char(pet)!=0 { 

      | check to see if we need to heal our pet. 
      /if n $spawn($char(pet),hp,pct)<50 { 

         /target id $char(pet) 
         

         /delay $int($calc($spell("@PetHealSpell",casttime)*10+5)) 
         /goto :StartSpells 
      } 

      | check to see if we need to buff our pet 
      /if n $PetHasteStatus==0 { 

         /target id $char(pet) 

         /delay $int($calc($spell("@PetBuffSpell",casttime)*10+5)) 
         /varset PetHasteStatus 1 
         /goto :StartSpells 
      } 
   } 
/return
Would this work? I have it added already an will be testing when I get home from work.

I didn't write this code. I borrowed if from another macro.

I take no credit for any of the above code.

reece
decaying skeleton
decaying skeleton
Posts: 8
Joined: Tue Oct 14, 2003 9:45 am

A Better Way

Post by reece » Tue Oct 21, 2003 11:50 am

Does anyone have a better way to handle adds than the way it is implimented in warrior's code. Warrior, your code works if you are getting a new target after your previous one is dead but what if you want to check for adds and slow them while fighting something else? If you notice in the following code you just hope that EQ autotargets the mob that is attacking you. Anyone have an idea (maybe using /target npc radius 20 and comparing id's)?

Code: Select all

   |Wait 3 seconds to see if you have an add on you 
   /if @WaitForAdds==1 { 
      /delay 3s 
      /if n $target(id)!=0 /goto  :HaveMob 
      /if $target()!="False" /goto  :HaveMob 
   } 
[/code]

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

Post by mackster » Wed Oct 22, 2003 3:09 pm

How could i modify this macro so that it doesn't target mobs that are very far away?

In an older version of this macro I inserted this line:

Code: Select all

   /target npc radius 400 "insertmobnamehere"
And this worked perfectly.

Any ideas how to include this in the new version? Thanks.

Guest

Post by Guest » Wed Oct 22, 2003 4:56 pm

/varset MainArray(2, 8) "werewolf"

ROTFLMAO

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

Post by mackster » Wed Oct 22, 2003 8:40 pm

Well I answered my own question. For those interested, change this line:

Code: Select all

/target nopcnear @KSRadius npc "@MainArray(2,$rand(@MobArraySize))"
to read:

Code: Select all

   /target nopcnear @KSRadius npc radius 200 "@MainArray(2,$rand(@MobArraySize))" 
Then just change the radius to what you want.

Oh yeah, you'll want to filter your MQ output or else you'll spam yourself silly. :lol:

EQ Rogue
orc pawn
orc pawn
Posts: 16
Joined: Tue Oct 28, 2003 3:31 pm

Post by EQ Rogue » Tue Oct 28, 2003 4:01 pm

Hi guys,

Trying to get this macro to work so I can hunt brigands and bandits to raise my Circle of Unseen Hands faction for my rogue. (Need to get my GM asssassins seal) Problem is, when I use GrimJack's macro all my char does is target the bandit, then move backwards in tiny increments. It will never move to the mob and attack.

So, I tried Weapons version. It targets the mob, and just runs aimlessly throughout the zone never going to the mob to attack it. And MQ returns a message:
There were no matches for. (0- 100) any nopredict

over and over again. Thanks for the great macro, but any ideas how I can fix this, or what's causing it? Any assistance with this would be greatly appreciated!
-
EQ Rogue

Guest

reply

Post by Guest » Tue Oct 28, 2003 5:16 pm

remove nopredict from distance() and the /face fast

EQ Rogue
orc pawn
orc pawn
Posts: 16
Joined: Tue Oct 28, 2003 3:31 pm

Post by EQ Rogue » Wed Oct 29, 2003 1:09 am

Actually I found out it's the new compile of MQ thats doing it. None of my combat macros are working correctly. The Rogue Assist and Get Behind macros that I use were doing the same thing as this one was.

Also, every time I switch skins to do trades, the EQ client crashes to desktop once i try to run a macro. Had to revert to an older build. I'll test it later on tonight and see how it works, The Rogue Assist and Get Behind work as they used to now, so I expect this one will work as designed as well. :^)

This is an awesome program guys, soon as I get working again a fat donation is coming. You have made the game fun for me again. :^)
-
EQ Rogue

User avatar
Jon100
a hill giant
a hill giant
Posts: 161
Joined: Mon Sep 22, 2003 6:15 am
Location: UK

Post by Jon100 » Wed Oct 29, 2003 8:10 am

Very nice piece of code. Thank you everyone that wrote it.


I've made a few modifications that I'd like to throw into the pot. Please feel free to use them or not :)

1) Added target prioritisation. Many times I find there is one particular target I'd like to focus on, and kill other mobs only if the primary target is not up. This is great for killing PHes for instance.

2) Added some additional anti-KS code. The code now checks that a player isnt within the KS radius both when aquiring a target, and when arriving at the target. If a player is close to the target when we arrive, you now run past without attacking. If a player comes close mid-fight, you now pull the target away with you to give a bit of space.

3) Added rebuffing code. Its not very elegant, but you can provide a list of buffs you would like to maintain. There is no code to deal with fizzles or interupts, but the rebuff will just attempt again after the next mob.

Minor changes:
- moved /lootnodrop so its only called once.
- sped up the loot speed slightly.
- increased KSradius from 60 to 400. (Players with bows can easily exceed range 60).
- always turn off combat after fight.

Enjoy.

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. 



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 AttackRange global 
   /declare MobArraySize global 
   /declare WaitForAdds global

   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset RangeMax 12 
   /varset RangeMin 10 
   /varset AttackRange 15 
   /varset LootSlot 0 
   /varset CheckLoot 0 
   /varset KSRadius [color=red]400[/color]
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset WaitForAdds 1 

[color=red]
| Add your main target here. Comment out if no main target.
   /declare PriorityMob global
   /varset PriorityMob "spider"
[/color]

| Add your secondary targets here. If no primary target is up, the closest secondary is picked. Make sure you increase MobArraySize

   /varset MobArraySize 4
   /varset MainArray(2,0) "wolf" 
   /varset MainArray(2,1) "lion" 
   /varset MainArray(2,2) "stalker" 
   /varset MainArray(2,3) "hound" 


| Add the loot to keep here. Make sure you increase LootTotal 
   /varset LootTotal 5
   /varset MainArray(1,0) "silk" 
   /varset MainArray(1,1) "quality" 
   /varset MainArray(1,2) "wolf meat" 
   /varset MainArray(1,3) "chunk of meat" 
   /varset MainArray(1,4) "halfling parts" 

[color=red]
    /lootn never 
    /call CheckBuffs
[/color]

   :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 
[color=red]
   /call CheckBuffs
[/color]
   /goto :Start 
/return 



Sub GetTarget 
   /declare MobNumber local 
   /declare NumberOfMobsFound local 
   /declare CurrentMobToCheck local 
   /declare ClosestMob local 

   /varset TargetDead 0 

   :Aquire 

   |Wait 3 seconds to see if you have an add on you 
   /if @WaitForAdds==1 { 
      /delay 3s 
      /if n $target(id)!=0 /goto  :HaveMob 
      /if $target()!="False" /goto  :HaveMob 
   } 

   |Check if your pet is attacking anything 
   /if $char(pet)!=0 { 
       /target id $char(pet) 
       /assist %t 
       /if n $target(id)==$char(pet) /goto  :PetDoesntHaveTarget 
       /if n $target(hp,cur)<1 /goto :PetDoesntHaveTarget 
   } 

   |Loop through the mob list and get the distance of every mob 
   :PetDoesntHaveTarget 

   /varset MobNumber "0" 
   /varset NumberOfMobsFound 0 

   :MobListCycle 
       /target nopcnear @KSRadius npc "@MainArray(2,@MobNumber)" 
       /if $target()!="False" { 
          /varset MainArray(3,@NumberOfMobsFound) $target(id) 
          /varadd NumberOfMobsFound 1 
       } 
       /varadd MobNumber 1 
       /if n @MobNumber==@MobArraySize /goto :DoneMobListCycle 
       /goto :MobListCycle 
   :DoneMobListCycle 

   |Do a check to see which mob in the mobs list is the closest 
   /varset CurrentMobToCheck 0 
   /varset ClosestMob 0 

   :MobListClosest 
       /if n $spawn(@MainArray(3,@CurrentMobToCheck),distance)<$spawn(@MainArray(3,@ClosestMob),distance) { 
          /varset ClosestMob @CurrentMobToCheck 
       } 
       /varadd CurrentMobToCheck 1 
       /if n @CurrentMobToCheck==@NumberOfMobsFound /goto :DoneMobListClosest 
       /goto :MobListClosest 
   :DoneMobListClosest 

   /target id @MainArray(3,@ClosestMob) 

[color=red]
   | Check for priority target
   /if "$defined(PriorityMob)"!=FALSE /target nopcnear @KSRadius npc @PriorityMob
[/color]

   /varset MyTarget $target(id) 

   /if n $target(id)==0 /goto :Aquire 
   /if $target()=="False" /goto :Aquire 

   :HaveMob 
   /varset HasTarget 1 
   /varset MobToHunt $target(name) 
/return 

sub MoveToMob 
   /if n $target(distance)<=@AttackRange { 
      /face fast look nopredict 
      /return 
   } 
   /sendkey down up 
   :Movementloop 


       /delay .5s 
       /varset MyXLoc $char(x) 
       /varset MyYLoc $char(y) 
       /varadd ObstCount 1 
       /if $target()=="FALSE" { 
          /varset HasTarget 0 
          /return 
       } 
       /face fast look nopredict 
       /if n $target(distance)<=@AttackRange { 
          /face fast look nopredict 
          /sendkey up up 
          /return 
       } 
       /if @ObstCount>=3 { 
          /call CheckObst 
          /goto :Movementloop 
       } 
   /if n $target(distance)>@AttackRange /goto :MovementLoop 
   /doability "sneak" 
/return 

Sub CombatSub 

/declare combattarget local

   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 

/varset combattarget $target(name)

   :CombatLoop 
      /attack on 
      :CombatMove 

[color=red]
         | Check no PCs are in KSradius still
         /if n $searchspawn(pc,radius:@KSradius)!=0 {
           /press esc
           /attack off
           /sendkey down up
           /delay 10s
           /sendkey up up
           /goto :WeKilledIt
         }
[/color]

         /delay .5s 
         /varset MyXLoc $char(x) 
         /varset MyYLoc $char(y) 
         |Check if we still have target to chase 
         /if n $target(id)==0 /goto :WeKilledIt 
         |Check if we are in range 
         /if n $target(distance)>=@AttackRange { 
           /face fast look nopredict 
           /sendkey down up 
           /goto :CombatMove 
         } 

         /varadd ObstCount 1 

         /face fast look nopredict 
         /if n $target(distance)<=@AttackRange { 
           /face fast look nopredict 
           /sendkey up up 
           /goto :InAttackRange 
         } 
         /if @ObstCount>=3 { 
           /call CheckObst 
           /goto :CombatMove 
         } 
      /if n $target(distance)>@AttackRange /goto :CombatMove 
      :InAttackRange 
   /if n @TargetDead!=1 /goto :CombatLoop 
    
   :WeKilledIt 
   /sendkey up up

[color=red]
   /attack off
[/color]
/return 

Sub LootMob 
   /varset LootSlot 0 
   /delay 1s 
   /target corpse 
   /delay 1s 
   /loot 
   |Wait for loot window to come up 
   /delay 1s 

   :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 [color=red]0.5s [/color]
          /click left auto 
          /delay [color=red]0.5s [/color]
          /varadd LootSlot 1 
          /goto :lootloop 
       } 
       /varadd CheckLoot 1 
       /if "$cursor()"=="TRUE" { 
          /if n @CheckLoot<@LootTotal /goto :lootchecker 
       } 
       /if "$cursor()"=="TRUE" { 
          /delay [color=red]0.5s [/color] 
          /click left destroy 
          /delay [color=red]0.5s [/color]
       } 
       /varadd LootSlot 1 
       /varset CheckLoot 0 
   /goto :lootloop 
   :doneloot 
/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 nopredict 
         /doability "Backstab" 
      } 
   } 
/return 

[color=red]
Sub CheckBuffs

  /call SelfBuff "spirit of wolf"
  /call SelfBuff "regrowth"
/return



Sub SelfBuff

  /if n $char(buff,"@Param0")==0 {
    /press f1
    /delay 1

    /cast "@Param0"
    /delay "$calc($spell("@Param0",casttime)+4.5)"s

    /press esc
  }
/return
[/color]

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

problem

Post by tac8357 » Sat Nov 01, 2003 11:49 pm

Its a sweet ass script buttt it quit running awhile back right now it targets a mob and runs in the direction you where facing instead of facing the target. Wish it was fixed

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

Post by Stogar » Thu Nov 06, 2003 11:24 pm

As of Nov 6 2003 it's running backwards. I tested a couple other auto hunters, as well as the necrofarm scripts and they all seem to do the same thing.

I'm using the 110603 (pm) MQ from irclatest.zip and the current versions of each of the macros.

Just tested now, trying to figure out why, maybe the authors will get to them.

User avatar
Jon100
a hill giant
a hill giant
Posts: 161
Joined: Mon Sep 22, 2003 6:15 am
Location: UK

Post by Jon100 » Fri Nov 07, 2003 9:30 am

I find that sometimes the corpse is outside the loot range. This is fairly common with mobs that run when at low hp.

A small modification:

Code: Select all

Sub LootMob 
[color=red]
   /declare loottimer timer
[/color]


   /varset LootSlot 0 
   /delay 1s 
   /target corpse 
   /delay 1s 
[color=red]
   /varset loottimer 10s

   :movetocorpse
     /face fast
     /press up
     /if n @loottimer==0 /goto :movetocorpseover
   /if n $target(distance)>15 /goto :movetocorpse

   :movetocorpseover

[/color]
   /loot 
   |Wait for loot window to come up 
   /delay 2s 

etc
edit: added some safety code.., it is possible that you may get stuck moving to the corpse. if you fail to arrive after 10 seconds the loop is now broken out of.
Last edited by Jon100 on Fri Nov 07, 2003 11:27 am, edited 1 time in total.

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

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

One thing I did notice with this script (haven't used it in about a month so not sure if its been looked at or not).

1. The anti-KS code dosn't seem to work well. I think its checking mob health only once. So if your on your way to a mob and it gets attacked before you get to it it still attacks.

2. Back in the old days I used the old hunter.mac and this new hunter.mac seems to have the same problem. lets assume were hunting rat's. I have ShowEQ up and running as well. Anyways so you kill a rat. insted of the macro targeting the next nearest rat it will target one half way across the zone or sit and wait a few seconds like there are no more rats to kill in the zone when there are plenty.

On my wish list for this macro would be zone .ini support for areas/mobs to avoid in said zone. Myabe .ini file support for mobs to hunt and what to loot as well would be nice..