skellies.mac - Bone Chips Collector

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

Moderator: MacroQuest Developers

TheWarden
a hill giant
a hill giant
Posts: 253
Joined: Sat Dec 27, 2003 3:51 pm
Location: In your bushes...

skellies.mac - Bone Chips Collector

Post by TheWarden » Thu Jan 01, 2004 4:09 pm

Collect Bone Chips from decaying skeletons. Seems to mess up if a Decaying Skeleton is targeted real close to you, may not loot it. Change it if ya wish:

Code: Select all

|skellies.mac  Bone Chip Collector by TheWarden 
| 
|Based soley on the giants.mac and hunter.mac, credit goes to the authors of those scripts. 
| 
|Seeks decaying skeletons and kills them.  
|Just uses your pet, will cast no spells, will not stop until told, I don't know if 
|it will stop if there are GM's in the zone, have not been able to try that. 

#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 alt 
   /press shift 
   /press ctrl 
   /varset AntiKSMinDist 1 
   /varset AntiKSMaxDist 50000 
   /varset AntiKSMob 0 
   /varset RangeMax 200 
   /varset RangeMin 10 
   /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 "In the Bathroom, BRB." 

|----------------------------------------------------------------------------------------------- 
| 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) "Bone Chips" 

|----------------------------------------------------------------------------------------------- 
| Add as many of these  as you want but make sure you 
| increase LootTotal to match your settings above. 
|----------------------------------------------------------------------------------------------- 

   /varset MainArray(2,0) "Decaying Skeleton" 

|----------------------------------------------------------------------------------------------- 
| 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 $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 $gm==TRUE /call DummyMode 
   /varset MobPriority 0 
   :Aquire 
   /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 1s 
   /goto :Aquire 
        }    
   /varset MyTarget $target(id) 
   /varset TargetDead 0 
   /if n $target(id)==0 { 
   /delay 1s 
   /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  
   /face fast 
   /if n $target(distance)>=@FastRange /call Fastmove 
   /if n $target(distance)>@RangeMax { 
      /press up 
   } 
/return 

|----------------------------------------------------------------------------------------------- 
|----------------------------------------------------------------------------------------------- 

Sub Fastmove 
   /if $gm==TRUE /call DummyMode 
   /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 $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /assist 
   /delay 1s 
   /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 
   } 
   /delay 1 
   /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 DECAYING SKELETONS 
|                 .... Remove the DECAYING portion. 
|----------------------------------------------------------------------------------------------- 
   /target corpse decaying 
   /delay 1 
   /varadd MobsKilled 1 
   /varset AntiKSMob 0 
   /varset AntiKSMinDist 1 
/return 

|----------------------------------------------------------------------------------------------- 
|----------------------------------------------------------------------------------------------- 

sub LootMob 
   /if $gm==TRUE /call DummyMode 
   /loot 
   /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 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 
      /destroy 
      /delay 1s 
   } 
   /varadd LootSlot 1 
   /varset CheckLoot 0 
   /goto :lootloop 
   :doneloot 
   /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 
   /delay 1 
   /press esc 
/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 1 
      /sendkey up down 
      /sendkey down Right 
      /delay @Param0 
      /sendkey up Right 
      /sendkey down up 
      /delay 1 
      /sendkey up up 
   } else { 
      /delay 1 
      /sendkey up down 
      /sendkey down left 
      /delay @Param0 
      /sendkey up left 
      /sendkey down up 
      /delay 1 
      /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 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 1s 
   /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 1s 
/return 

|----------------------------------------------------------------------------------------------- 
|----------------------------------------------------------------------------------------------- 

Sub AttackAnyway 
   /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 DECAYING SKELETONS 
|                 .... Remove the DECAYING portion. 
|----------------------------------------------------------------------------------------------- 
   /target corpse decaying 
   /delay 1 
   /varadd MobsKilled 1 
   /varset AntiKSMob 0 
   /varset AntiKSMinDist 1 
/return

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Wed Jan 07, 2004 1:23 pm

Think I'll use this, but change it around so my druid can farm for chips in Kurn's.

He doesn't have baby bear yet, so it'd be easier to keel with roots.

Thanks for the starting point, TheWarden.
-Elric