Hill Giant Hunter for Necromancers (Converted)

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

Moderator: MacroQuest Developers

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Hill Giant Hunter for Necromancers (Converted)

Post by elretardo » Tue Oct 28, 2003 6:55 pm

This is a modified hunter.mac, which was originally scripted by grimjack.

Basically, this hunts for Hill Giants in RM and pet kites them. Took awhile to get everything working properly but it's all tested except for the GM avoidance stuff. It all works as intended.

Thanks to grimjack for the help with the movetocorpse sub.

P.S. Turn off wordwrap in notepad when you paste this. Some of the lines may run long so if you get syntax errors, just reset the stuff that's overflowing on to the next line.

Code: Select all

giants.mac 
| Hill Giant Hunter for Necromancers by elretardo
|
| Credits:
| Original Script by grimjack
| New Anti-KS concept by switch, created by elretardo
| Prioritized hunting enhancement by theafkxper
|
| 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

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 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
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl
   /varset AntiKSMinDist 1
   /varset AntiKSMaxDist 50000
   /varset AntiKSMob 0
   /varset RangeMax 160
   /varset RangeMin 100
   /varset FastRange 180
| 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 0
|  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| 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 15m
  /varset DummyMsg "Gone to watch a movie bbl.."
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 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) "Peridot" 
| Add as many of these  as you want but make sure you 
| increase LootTotal to match your settings above.
   /varset MainArray(2,0) "Hill Giant"
| Add as many of these as you want but make sure you 
| increase MobArraySize to match your settings above.
   /varset LootTotal 1
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset MobArraySize 1
   :Start 
   /if n $char(hp,pct)<=70 /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 
   /if $char(buff,1)=="NULL" /call Rebuff
   /if $gm==TRUE /call DummyMode
   /if n $char(hp,pct)<=70 /call EvadeDeath
   /if n $char(mana,pct)<=50 /call MedTime
   /varset MobPriority 0
   :Aquire 
   /if n $char(hp,pct)<=70 /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)<=70 /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)<=70 /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 

sub CombatSub 
   /varset AntiKSMob $target(id)
   /if $gm==TRUE /call DummyMode
   /if n $char(hp,pct)<=70 /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
   }
   /cast "Clinging Darkness"
   /delay 2s
   /pet attack
   :combatloop 
   /face fast  
   /call MoveToMob 
   /face fast   
   /if n $target(id)==0 /varset TargetDead 1 
   /if n @TargetDead!=1 /goto :combatloop 
   /sendkey up up 
|  CHANGE THE BELOW LINE IF YOU'RE NOT FARMING HILL GIANTS
|                 .... Remove the HILL portion.
   /target corpse hill
   /lootn never 
   /delay 2s 
   /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 
   /target pet
   /if n $target(hp,pct)<=70 /cast "Touch of Death"
   /delay 4s
   /press esc
|   /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

Sub EvadeDeath
	/echo $char(hp,pct)% health is too low: Lifetapping.
	:evade
	/target npc radius 300
	/delay 1s
	/cast "Touch of Mujaki"
	/delay 1s
	/cast "Touch of Mujaki"
	/delay 1s
	/cast "Touch of Mujaki"
	/delay 1s
	/cast "Touch of Mujaki"
	/delay 4s
	/press esc
	/if n $char(hp,pct)<=70 {
		/echo $char(hp,pct)% health is still too low.  Lifetapping again..
		/goto :evade
	} else {
		/stand
		/echo $char(hp,pct)% health is satisfactory.  Continuing the hunt!
	}
/return

Sub MedTime
	/echo $char(mana,pct)% mana is too low: Meditating.
	:medup
	/sendkey up down
	/cast "Seduction of Saryrn"
	/delay 1s
        /cast "Seduction of Saryrn"
	/delay 1s
        /cast "Seduction of Saryrn"
	/delay 1s
	/cast "Seduction of Saryrn"
	/delay 4s
	/sit
	/delay 60s
	/if n $char(mana,pct)<=80 {
		/echo $char(mana,pct)% mana is still too low.  Meditating again..
		/goto :medup
	} else {
		/stand
		/delay 1s
		/cast "Seduction of Saryrn"
		/delay 1s
		/d
		/delay 1s
		/d
		/echo $char(mana,pct)% mana is satisfactory.  Continuing the hunt!
	}
/return

Sub Rebuff
   /cast "Rune of Death"
   /delay 1s
   /cast "Rune of Death"
   /delay 1s
   /cast "Rune of Death"
   /delay 1s
   /cast "Rune of Death"
   /delay 7s
   /press @JBootKey
   /delay 1s
   /press esc
/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(type)!="NPC" {
		/goto :AntiKS
        } else {
		/echo $target(name) is not engaged.  Just low on health.  Engaging.
    		/call AttackAnyway
		}
 	: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 AttackAnyway
   /if n $char(hp,pct)<=70 /call EvadeDeath
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /pet attack
   :combatloop 
   /face fast  
   /call MoveToMob 
   /face fast   
   /if n $target(id)==0 /varset TargetDead 1 
   /if n @TargetDead!=1 /goto :combatloop 
   /sendkey up up 
|  CHANGE THE BELOW LINE IF YOU'RE NOT FARMING HILL GIANTS
|                 .... Remove the HILL portion.
   /target corpse hill
   /lootn never 
   /delay 2s 
   /varadd MobsKilled 1
   /varset AntiKSMob 0
   /varset AntiKSMinDist 1
/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
Last edited by elretardo on Wed Nov 12, 2003 5:13 am, edited 14 times in total.
I must go, for there they go and I am their leader.

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Wed Oct 29, 2003 2:56 am

Edited in a few quick updates.

--Fast Silver/Copper destroy on loop reset, which relies on mouse coordinates at the moment. Could be harmful if not set correctly but otherwise, a very useful inclusion.

--Radius based target aquire for Lifetap. There was a problem that was causing you to target random NPCs outside of your cast range, which should no longer be an issue.

That's all for now :)
I must go, for there they go and I am their leader.

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Wed Oct 29, 2003 3:57 am

More updates..

--Added a 1s delay before clicking the destroy button after my client crashed a couple (4) times.

--Removed Seduction of Saryrn from the Rebuff Sub because it's actually a lot safer to run around without lich on and just med up when needed. (Go figure, eh?)

If you don't have Jboots, get a clicky item and put it in the slot you assign to @JBootKey so buff slot 1 will be taken up, allowing the Sub to do it's thing.
I must go, for there they go and I am their leader.

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Wed Oct 29, 2003 12:44 pm

More updates woo..

--Added a pet health check to the reset sub so you don't waste mana healing a pet with good health still.

--Revamped Anti-KS code. It's a lot smarter now and won't retarget the shit you just decided not to KS.
I must go, for there they go and I am their leader.

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Thu Oct 30, 2003 10:13 am

Added a 1s delay before the pet attack in the combat Sub because it was still sending the pet sometimes before the Anti-KS did its thing. Seems to be fixed now /shrug
I must go, for there they go and I am their leader.

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

problem

Post by tac8357 » Sun Nov 02, 2003 12:01 am

i'am getting this everytime i run this [ there are no matches for: (1-100) no predict

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Tue Nov 11, 2003 7:20 am

Sorry it took so long to update for the newer release of MQ, which took out NOPREDICT in /face. Basically, nopredict was a way to tell /face to look directly at the target as opposed to trying to predict it's pathing. Now that MQ does it automatically (Has for awhile I think, they just took it out a little bit ago), it was trying to search for nopredict in the target's name.

Anyway, that's fixed.

I also made the Anti-KS scripting a little more infoulable. It will assist before attacking to determine whether or not the mob is engaged. I also have it using clinging darkness to pull before sending your pet because I was running into the issue of outrunning my pet (Run3) to a mob. So, it would attack after it made the Anti-KS check and sometimes someone would come along and gank the mob before the pet got there. No good.

That should all be in order now. I've tested the script pretty extensively since I've been messing with MQ a little more the last day or so after taking a short break from EverQuest. Everything should work properly:)

Enjoy.
I must go, for there they go and I am their leader.

elretardo
a lesser mummy
a lesser mummy
Posts: 36
Joined: Thu Oct 16, 2003 3:24 am

Post by elretardo » Wed Nov 12, 2003 5:17 am

Updates--

Added a corpse check to the Anti-KS portion of the script so if a hill giant stumbles into you and you kill it, when you target the corpse, it won't look at the 0% life on it and think it's engaged.

Uhh, updated some other stuff but it's 5:15am and I can't remember what I did now. I should start commenting my code, eh?

Also: You may notice that your main chat box locks up when you're in the process of moving to the mob. I think that's a MQ issue with /press and not the script's fault. It's still annoying, though. Just wanted to let you know, in the immortal words of Bart Simpson, "I didn't do it."
I must go, for there they go and I am their leader.

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Post by Dniper » Tue Dec 02, 2003 3:50 pm

Very cool elretardo