Loot the bodies of the sonic/owlbear in hollowshade

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

Moderator: MacroQuest Developers

honduras
orc pawn
orc pawn
Posts: 14
Joined: Sat Aug 30, 2003 5:22 pm

Loot the bodies of the sonic/owlbear in hollowshade

Post by honduras » Sat Nov 22, 2003 12:14 am

greeting comrades
Oh , i hate those silly looting so i made these

I AEed them, and turn it on to loot the substances.
-Adapted from Grimjacks hunter mac-
*only face corpse, target and loot
*will return if item is looted or corpse is empty (to counteract server spikes)
*Now i can two hands off the keyboard.

Code: Select all

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 bobo global
   /declare MobArraySize global 
   /varset LootSlot 0 
   /varset CheckLoot 0 
   /varset MainArray(1,0) "substance" 
   /varset MainArray(1,1) "substance"
| Add as many of these  as you want but make sure you 
| increase LootTotal 
   /varset MainArray(2,0) "sonic" 
   /varset MainArray(2,1) "bear" 
| Add as many of these as you want but make sure you 
|  increase MobArraySize 
   /varset LootTotal 2 
   /varset KSRadius 100 
   /varset bobo 0
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset MobArraySize 2 
   :Start 
   /call GetTarget 
   /call MoveToMob 
 /call LootMob 
   /call ResetSub 
   /goto :Start 
/return 



sub GetTarget 
   :Aquire 
   /target corpse radius 100
|   /target corpse "@MainArray(2,$rand(@MobArraySize))"
   /varset MyTarget $target(id) 
   /varset TargetDead 0 
   /delay 2
   /if n $target(id)==0 /goto :Aquire 
   /if $target()=="False" /goto :Aquire 
   /varset HasTarget 1 
   /varset MobToHunt $target(name) 
/return 



sub MoveToMob 
   /if n $target(distance)<=13 { 
      /face fast look
      /return 
   } 
   /sendkey down up 
   :Movementloop 
   /if $target()=="FALSE" { 
      /return 
   } 
   /face fast look
   /if n $target(distance)<=13 { 
      /face fast
      /face fast
      /sendkey up up 
      /return 
   } 
   /if n $target(distance)>5 /goto :MovementLoop 
/return 


sub LootMob 
 /loot  
/loot
:waitloot
   /delay 2
   /if $corpse()!=TRUE /goto :waitloot
   /delay 3
:lootloop 
:wait1 
   /click left corpse @LootSlot 
   /delay 3
   /varadd bobo 1
   /if n @bobo>=3 /goto :doneloot
   /if $cursor()!=TRUE /goto :wait1
    /if $cursor()==TRUE /goto :lootChecker
:lootChecker 
   /delay 3
   /if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" { 
      /autoinv 
      /varadd LootSlot 1
      /varset bobo 0
     /if $corpse(empty)==TRUE /goto :doneloot
      /goto :lootloop 
   } 

   /if $cursor()==TRUE { 
       /click left destroy 
       /delay 3
      /varset bobo 0
      /varadd LootSlot 1 
/if $corpse(empty)==TRUE /goto :doneloot
     /goto :lootloop 

   } 
   :doneloot 
   
   /varset LootSlot 0 
   /varset bobo 0
   /if $cursor()==TRUE /goto :lootChecker
   /click left corpse done



/return 




sub ResetSub 
   /sendkey up up 
   /press esc 
   /press alt 
    /press i
   /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
 

Drunkensloth
a lesser mummy
a lesser mummy
Posts: 67
Joined: Sat Oct 18, 2003 2:54 am

Re: Loot the bodies of the sonic/owlbear in hollowshade

Post by Drunkensloth » Sun Nov 23, 2003 4:13 pm

honduras wrote:

Code: Select all

Sub BackstabIt 
   /if n $char(ability,"Backstab")!=-2 { 
      /if $target()=="TRUE" { 
         /face fast nopredict 
         /doability "Backstab" 
      } 
   } 
/return
 

playing the new class thats coming out with GoD(new eq expansion)? that can both AE and backstab? uber :P

you should just delete that part out


you are declaring stuff into an array, but then not using the array to decide targets might want to delete that as well

Code: Select all

sub LootMob 
/loot  
/loot 
:waitloot 
   /delay 2 
   /if $corpse()!=TRUE /goto :waitloot 
   /delay 3 
:lootloop 
:wait1 
   /click left corpse @LootSlot 
   /delay 3 
   /varadd bobo 1 
   /if n @bobo>=3 /goto :doneloot 
   /if $cursor()!=TRUE /goto :wait1 
    /if $cursor()==TRUE /goto :lootChecker 
:lootChecker 
   /delay 3 
i dont understand what the purpose of bobo is here..
what if the shreiking or wailing substance is the 4th drop? looks like your macro will just leave it or something...
And here I was clicking like a sucker!

Zapheous
decaying skeleton
decaying skeleton
Posts: 8
Joined: Tue Nov 25, 2003 4:49 am

Post by Zapheous » Thu Nov 27, 2003 9:52 am

I modified this code just a bit because I could loot myself faster than with this macro. This looks alot like basic programming with some object orientedness thrown in ... but not totally one or the other.

There is a lot that can be done to change this into an easy to use generalized looter. And a lot of optimization that could be done to make it faster and more efficient with less lines of code. But I am too tired and I am just using this for it's functionality atm. I may update it nicely soon =)

Anyways - this runs great on my machine, but as always - your mileage may vary =)

Code: Select all

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 bobo global 
   /declare MobArraySize global 
   /varset LootSlot 0 
   /varset CheckLoot 0 
   /varset MainArray(1,0) "substance" 
   /varset MainArray(1,1) "substance" 
| Add as many of these  as you want but make sure you 
| increase LootTotal 
   /varset MainArray(2,0) "sonic" 
   /varset MainArray(2,1) "bear" 
| Add as many of these as you want but make sure you 
|  increase MobArraySize 
   /varset LootTotal 2 
   /varset KSRadius 100 
   /varset bobo 0 
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset MobArraySize 2 
   /echo * Hollowshade Moor Substance Auto-Loot *
   :Start 
   /call GetTarget 
   /call MoveToMob 
/call LootMob 
   /call ResetSub 
   /goto :Start 
/return 



sub GetTarget 
   :Aquire 
   /target corpse radius 100 
|   /target corpse "@MainArray(2,$rand(@MobArraySize))" 
   /varset MyTarget $target(id) 
   /varset TargetDead 0 
|   /delay 2 
   /if n $target(id)==0 {
	/echo *** No corpses found *** Ending Macro ***
	/endmacro
   }
   /if $target()=="False" {
	/echo *** No corpses found *** Ending Macro ***
	/endmacro
   }
   /varset HasTarget 1 
   /varset MobToHunt $target(name) 
/return 



sub MoveToMob 
   /if n $target(distance)<=13 { 
      /face fast look 
      /return 
   } 
|   /sendkey down up 
|   :Movementloop 
|   /if $target()=="FALSE" { 
|      /return 
|   } 
|   /face fast look 
|   /if n $target(distance)<=13 { 
|      /face fast 
|      /face fast 
|      /sendkey up up 
|      /return 
|   } 
|   /if n $target(distance)>5 /goto :MovementLoop 
   if n $target(distance)>13 {
	/face fast
	:MoveThere
	/face fast
	/sendkey down up
	/if n $target(distance)<=13 {
	   /sendkey up up
	   /return
	}
	/goto :MoveThere
   }
/return 


sub LootMob 
/loot  
/loot 
:waitloot 
   /if $corpse()!=TRUE /goto :waitloot 
:lootloop 
:wait1 
   /click left corpse @LootSlot 
|   /delay 1
   /varadd bobo 1 
   /if n @bobo>=3 /goto :doneloot 
   /if $cursor()!=TRUE /goto :wait1 
    /if $cursor()==TRUE /goto :lootChecker 
:lootChecker 
   /delay 1
   /if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" { 
      /autoinv 
      /varadd LootSlot 1 
      /varset bobo 0 
     /if $corpse(empty)==TRUE /goto :doneloot 
      /goto :lootloop 
   } 

   /if $cursor()==TRUE { 
       /click left destroy 
|       /delay 3 
      /varset bobo 0 
      /varadd LootSlot 1 
/if $corpse(empty)==TRUE /goto :doneloot 
     /goto :lootloop 

   } 
   :doneloot 
    
   /varset LootSlot 0 
   /varset bobo 0 
   /if $cursor()==TRUE /goto :lootChecker 
   /click left corpse done 



/return 




sub ResetSub 
   /sendkey up up 
   /press esc 
   /press alt 
    /press i 
   /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