Radius Hunter v 2.0

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

Moderator: MacroQuest Developers

jcooler
a ghoul
a ghoul
Posts: 87
Joined: Wed Dec 31, 2003 7:38 pm

Radius Hunter v 2.0

Post by jcooler » Sun Jan 25, 2004 7:38 pm

V 3.0 will have ....... hehe i can;t thikn of anything to add =p

Code: Select all

|radius.mac 
|
|
|
|To run macro type
|
|.... /mac radius.mac "MOB_NAME" "LOOT_NAME" "RADIUS" "Xloc "Yloc"
|
|The two locs will be your anchor
|
|This macro will kill a mob of your choice inside any radius you want and loot it. After looting it will see if any more mobs are close to it before 

|returning to anchor. 
|
|WARNING ---- DO NOT USE UNDER GROUND ----- if you are in a shallow tunnle and your mob walks on the ground over your head you will target him and try to 

|kill him .... but you can;t cause you can not get to him in this macro 
|
|This macro uses SUB ATTACK .... Which is ment for WARRIORS .... you can put whatever you want in SUBATTACK that fits your class 
|
|THANKS TO 
|Hunter.mac by Grimjack 
|SUb attack by Mckorr 
|Sub movetoloc by Grimjack 
|
|NEW IN V 2.0 ..... ADD,PC and GM deceation.....Will camp out if you die ....
|===================================================================================================



#event Died       "You have entered"

Sub Main(p0,p1,p2,p3.p3)

/declare mob1 global
/declare MainArray array2
/declare LootSlot global
/declare CheckLoot global 
/declare LootTotal global
/declare anchorX global
/declare anchorY global
/declare KSRadius global 
/declare radius global
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
/verset radius "p2"
/varset mob1 "p0"
/varset MainArray(1,0) "p1" 
/varset anchorX "p3"
/varset anchorY "p4"
/varset KSradius 10
/varset LootSlot 0 
/varset CheckLoot 0 
/varset LootTotal 2
	/alert clear alerts
	/alert add 1 npc radius @radius "mob1"
	/alert add 2 npc radius @radius "corpse"
	/alert add 3 npc radius 10 "npc"
 :Loop
 	/if $alert(1)==TRUE /call target
	/if $alert(2)==TRUE /call targetcorpse
	/if $alert(3)==TRUE /call targetadd
	/if $gm==TRUE /call camp
	/doevents
 	/if  n $char(x)!=@anchorX /if n $char(y)!=@anchorY /call movetoloc @anchorX @anchorY 	
/goto :loop
 /return

sub event_died
/sit
/delay 1s
/campdesktop
/end


sub targetadd
/target npc radius 10
/if $target(type)=="npc" /call attack
/return

sub target
/target npc "mob1" radius @radius nopcnear @KSradius
/delay 2
/if  n $target(name)=="goblin" /call attack
/return

sub targetcorpse
/target "corpse" radius @radius nopcnear @KSradius
/if  n $target(state)=="dead" /call movetocorpse
/return

sub movetocorpse
:Loop
	/face
      /if n $target(distance)>5 /sendkey down up
      /if n $target(distance)<100 /sendkey up up
      
        /delay 0
        /if  n $target(distance)=<10 /call corpse
/if "$target()"=="TRUE" /goto :Loop
/return

sub corpse 
/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 
      /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 never 
   /varset LootSlot 0 
/press esc 
/press esc 
/press esc 
/press esc 
/if $alert(2)==TRUE /call targetcorpse
/return 

Sub MoveToLoc 
    /if "$defined(Param0)"=="FALSE" /return 
    /if "$defined(Param1)"=="FALSE" /return 
    /if "$defined(param2)"=="FALSE" /return
    :LocMoveLoop 
    /if "$char(state)"=="SIT" /stand 
    /face nolook loc @Param0,@Param1 
    /if n $distance(@Param0,@Param1,@parm2)>5 /sendkey down up 
    /if n $distance(@Param0,@Param1,@parm2)<=5 { 
       /sendkey up up 
       /if "$char(state)"=="SIT" /stand 
       /return 
    } 
    /goto :LocMoveLoop 
/return

sub Attack 

  /declare MyXLOC global 
  /declare MyYLOC global 
  /declare ObstacleCount global 
  /declare targetarray array 
  
  /varset targetarray(0) "$target(name,clean)" 
  /varset targetarray(1) $target(level) 
  /varset targetarray(2) $target(name) 
  /echo Fighting a level @targetarray(1) @targetarray(0) 
  /varset targetarray(3) $target(id)
  /face  
  /call MovetoMob 

  :CloserAF 
    /if "$target(id)"!=@targetarray(3) /goto :EndAF 
    /if n $target(distance)>10 /press up 
    /if n $target(distance)<10 /press down 
    /if n $target(distance)<15 /attack on 
    /if n $target(distance)>15 /attack off 
    /if n $target(distance)>15 /call MovetoMob 
    /face fast 
    /if n $target(distance)<11 /if n $char(ability,"taunt")>0 /doability "taunt" 
    /if n $target(distance)<11 /if n $char(ability,"Kick")>0 /doability "Kick" 
    /if n $target(distance)<11 /if n $char(ability,"Disarm")>0 /doability "Disarm" 
     
    /goto :CloserAF 

  :EndAF 
    /echo The level @targetarray(1) @targetarray(0) is dead... 
    /sendkey up up 
    /sendkey up down 
    /attack off     
    /varset targetarray(3) 0 
    /if $alert(1)==TRUE /call target 
    /if $alert(2)==TRUE /call targetcorpse
    

/return 

sub MoveToMob 

  /varset MyXLOC $char(x) 
  /varset MyYLOC $char(y) 
  /varset ObstacleCount 0 
 
  /if n $target(distance)<=15 { 
    /face 
    /return 
  } 
  /sendkey down up 

  :Movementloop 
    /varadd ObstacleCount 1 
    /if $target()=="FALSE" /return 
    /face fast 
    /if n $target(distance)<=10 { 
      /face fast
      /sendkey up up 
      /return 
    } 
    /if @ObstacleCount>=3 { 
      /call CheckObstacle 
      /goto :Movementloop 
    } 
    /if n $target(distance)>10 /goto :MovementLoop 
/return 

sub CheckObstacle 
  /if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObstacle 
  /varset MyXLOC $char(x) 
  /varset MyYLOC $char(y) 
  /varset ObstacleCount 0 
/return 

sub HitObstacle 
  /call MoveToLoctwo @anchorX @anchorY
/return 

Sub MoveToLoctwo 
    /if "$defined(Param0)"=="FALSE" /return 
    /if "$defined(Param1)"=="FALSE" /return 
    :LocMoveLoop 
    /if "$char(state)"=="SIT" /stand 
    /face nolook loc @Param0,@Param1 
    /if n $distance(@Param0,@Param1)>5 /sendkey down up 
    /if n $distance(@Param0,@Param1)<=5 { 
       /sendkey up up 
       /if "$char(state)"=="SIT" /stand 
       /return 
    } 
    /goto :LocMoveLoop 
/return

sub camp
/sit
/delay 1s
/campdesktop
/end


JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Sun Feb 01, 2004 3:06 pm

anyone able to get this to work?

draco
a ghoul
a ghoul
Posts: 145
Joined: Thu Jan 29, 2004 7:06 pm
Contact:

Doesn't work yet

Post by draco » Sun Feb 01, 2004 11:43 pm

I tried. the other hunter.mac works well however.