Better way to track mob for melee kite script?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Sparky421
decaying skeleton
decaying skeleton
Posts: 7
Joined: Wed Jan 21, 2004 5:32 pm

Better way to track mob for melee kite script?

Post by Sparky421 » Tue Jan 27, 2004 5:38 pm

Code: Select all

#Event Hitme "hits YOU for " 
#Event Engage "ENGAGE" 

#turbo 90 

Sub Main 

/declare RangeLong global 
/declare RangeMax global 
/declare RangeMin global 
/declare FastRange global 
/declare MyXLOC global 
/declare MyYLOC global
/declare ObstCount global 
/declare doengage global
/declare TargetDead global
/varset doengage 0
/varset RangeMax 7
/varset RangeMin 3
/varset FastRange 12
/varset ObstCount 0


:Wait
/varset TargetDead 0 
/assist XXXXXX 
/delay 5 
/if "$target() "=="FALSE" { 
  /target XXXXXX 
  /face nopredict 
  /goto :Wait 
}

/if  "$target(type)"!="NPC"  { 
  /face nopredict 
  /goto :Wait
}
  
/tell XXXXX I have %t as my target
/stand

:attackcall
    /doevents
    /if n @doengage==1 {
    /goto :Attack 
    } else {
	/goto :attackcall
    }
/goto :Wait

:attack
/tell XXXXXX attacking %t
/call MoveToMob
/call CombatSub
/call ResetSub
/doability "Feign Death"

/goto :Wait


/return

Sub Event_Engage 
   /varset doengage 1 
/return

Sub Event_Hitme 
   /attack off 
   /doability "Feign Death" 
   /delay 1s 
   /stand 
   /attack on 
/return 


Sub MoveToMob 
   /face fast 
   /if n $target(distance)>=@FastRange /call Fastmove 
   /if n $target(distance)>=@RangeMax { 
      /press up
      /press up
      /press up
      /press up
       
   } 
   /if n $target(distance)<@RangeMin { 
      /press down 
   } 
/return 

Sub Fastmove 
   /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 
   /attack on
   :combatloop
   /echo target speed is $target(speed) 
   /doevents
   /face fast 
   /doability "Flying Kick"
   /echo before move $target(distance) 
   /call MoveToMob
   /echo after move $target(distance) 
   /face fast 
   /if n $target(id)==0 {
	/varset TargetDead 1
	/tell XXXXXX Target is dead
   } 
   /if n @TargetDead!=1 /goto :combatloop 
   /sendkey up up 
   /delay 2s 
/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 ResetSub 
   /sendkey up up 
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset doengage 0 
   /varset ObstCount 0 
   /delay 1s 
/return
Ok so this script lets me send my monk after a mob while I kite it around and around. Where you see the XXXXXX place the name of the char that will be doing the kiting or calling ENGAGE. It can be made so that info is passed to the macro, but I got lazy. The problem is the combat sub, which I took from hunter.mac, does not do a great job of staying within combat range of a moving mob. The mob in my case will always be snared and if I recall moving at 89.25 speed. I have played around with the min, max, and fast ranges to attain better results. I have also added extra /sendkey up up to try and keep close to the mob so /fastmove would not need to be called. Also with this I will never be running into anything so the obstacle checks really are not needed. So I have a few questions...

1. Would removing the obstacle checks improve the speed of the combat function?

2. Would cleaning out all unneeded lines in the combat script improve distance check performance?

3. Is there a way to set the speed of my char to that of the mob once I am in combat range?

4. Is all this not going to help since Imp dealing with the delay of information from server to client? (pets track real well)

5. Would a different turbo setting help?

Anyways the script works well enough as is to use, but would be a great script if there was a way to /stick (daoc command?) to a mob with much more reliability.

-Sparky421