How can I strafe?

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

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

How can I strafe?

Post by driftinsupra » Wed Oct 29, 2003 1:37 pm

First off I did search and really didnt come up with alot tht I could use. I currently have a script that kills a mob and then goes and loots it for me all the while I am in lich mode. The problem is if I am not paying close enough attention I tend to get stuck on things while moving towards the mob and my lich just sits there and eats me up. What I want to know is if there is anything I can pu in a loop like this:

Code: Select all

:corpseloop
 /face
 /call autorun 1
 /if n $target(distance,nopredict)>16 /goto :corpseloop
that would check everytime through if I was stuck on something and then strafe me to the left. Anyone have an suggestions?

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Oct 29, 2003 3:03 pm

A couple of the autofight macros, including hunter.mac I believe, have obstacle avoidance routines in them. Should be a minor problem to cut and paste them into your macro.
MQ2: Think of it as Evolution in action.

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Wed Oct 29, 2003 3:38 pm

OK I looked into hunter.mac and ended up comming up with this

Code: Select all

sub MovetoTarg
  /declare MyXLOC local 
  /declare MyYLOC local 
  /declare ObstCount local
 
  /varset MyXLOC $char(x) 
  /varset MyYLOC $char(y) 
  /varset ObstCount 0
  /face nopredict
  :mobloop
  /if n $target(distance,nopredict)>16 {
    /call autorun1
    /delay 2
    /varadd ObstCount 1 
    /if n @ObstCount>=3 { 
      /if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) {
        /sendkey up up 
        /sendkey down down 
        /if n $rand(99)>50 { 
          /delay 3s 
          /sendkey up down 
          /sendkey down Right 
          /delay 5 
          /sendkey up Right 
          /sendkey down up 
          /delay 3s 
          /sendkey up up 
       } else { 
          /delay 3s 
          /sendkey up down 
          /sendkey down left 
          /delay 5 
          /sendkey up left 
          /sendkey down up 
          /delay 3s 
          /sendkey up up        
       } 
     }
     /sendkey up down 
     /sendkey up Right 
     /sendkey up Left 
     /sendkey down up  
     }
     /varset MyXLOC $char(x) 
     /varset MyYLOC $char(y) 
     /varset ObstCount 0 
   }
  /goto :mobloop
  }
/return 
However this doesnt seem to do anything...any ideas?