Ranger Auto Pull

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

omper
a ghoul
a ghoul
Posts: 110
Joined: Sat Dec 06, 2003 10:46 pm

Ranger Auto Pull

Post by omper » Tue May 04, 2004 6:25 pm

First Attempt at this.. thanks to all that chipped in..

When you run the macro it will set your current position as anchor.. it will then proceed to find a mob within a range of 150. It can be used for tanks also if you want to modify it.


/macro rangerautopull.mac

Code: Select all

|  Rangerautopull.mac   v 0.1 alpha

| Writen by Omper 

#chat tell 
#include spellcast.inc 
#event GotHIT "Hit You For" 

/declare AnchorX float outer 
/declare AnchorY float outer 
/declare startpoint int outer  

Sub Main 
   	
	/echo Rangerautopull.mac 
	
	/varset AnchorX ${Me.X} 
	/varset AnchorY ${Me.Y} 
        /cleanup 
        /doevents 
        /call MoveToAnchor 
        /pause 10           
	/call Tarnpc
	
/return 


Sub Tarnpc   

   /target npc radius 150 
   /call Cast "ensnare     

/return 



Sub Event_GOTHIT 
    
   /attack on 
   :Loop 
      /if (${Target.Distance}>20) { 
            /keypress forward    
            } 
            /if (${Target.Distance}<10) { 
            /keypress back hold 
            /timed 1 /keypress back 
            } 
            /face nolook fast 
            /delay 0 
         /if (!${Target.ID}) { 
            /goto :End 
            } else { 
         /goto :Loop 
         } 

:End 
          /call MoveToAnchor 
/return 

Sub MoveToAnchor 
    /declare iCount int local 

    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
    /varset iCount 0 

    /echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}. 

:AnchorMoveLoop  
    /delay 1 
    /doevents 
    /face nolook loc ${AnchorY},${AnchorX} 
    
    /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) { 
       /keypress forward hold 
   } else { 
       /keypress forward 
        /return 
    } 

    /if (${iCount}>2) { 
        /call Detectobst 
        /face nolook loc ${AnchorY},${AnchorX} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+1 
    /goto :AnchorMoveLoop 
/return 

Sub Detectobst 
    /delay 2 
    /if (${fXLoc}==${Me.X}) /if (${fYLoc}==${Me.Y}) /call Hitobst 
    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
/return 

Sub Hitobst 
    /keypress forward 
    /keypress back hold 
    
    /if (${Math.Rand[2]}) {    
        /delay 2s    
        /keypress back 
        /keypress right hold 
        /delay 8 
        /keypress right 
        
        /delay 2s 
        /keypress back 
        /keypress left hold 
        /delay 8 
        /keypress left 
    } 
    /delay 10 
    /keypress forward hold 
/return

Zelker
a lesser mummy
a lesser mummy
Posts: 38
Joined: Fri Jan 03, 2003 3:01 pm

Post by Zelker » Wed May 05, 2004 3:23 pm

Looks like a nice and useful macro. I haven't tried it out yet but here are a few things I noticed.

Code: Select all

  /call Cast "ensnare
missing an endquote after ensnare

Code: Select all

#chat tell 
Is this need for something?

One other thing you might add, is a check to see if what you are pulling is too close to another mob. In which case you would have a multiple pull on your hands.

-Z

nbjeter3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Jan 21, 2004 12:18 am

okies.. More help.. Odd behavior

Post by nbjeter3 » Wed Aug 04, 2004 7:58 am

Ok, I made the slight code correction in the missing quotes posted above and got the macro to run. Herein lies the problem. Start macro Ranger runs out and KEEP running out. It has been Jokingly renamed the ranger auto suicide macro due to this odd behavior. Now the error I get is

/varset Variable fXLoc not found.
/varset Variable fYLoc not found.

I'm figgering this HAS to be the cause of the suicidal behavior of the poor ranger, Either that or he just gets so depressed about bein replaced by a bot that he kills himself... I dunno you tell me.. lol I can see two places in the code where the /varset fyLoc is called as well as an fxloc But cannot figger out for the life of me what they are supposed to do or represent. Can someone help please?
Don't hate Me cuz I'm beautiful.. I Can give you MUCH better reasons Than That....

Noone Likes A necro... till Mid-battle And They're OOM..

nbjeter3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Jan 21, 2004 12:18 am

oh yeah

Post by nbjeter3 » Wed Aug 04, 2004 8:02 am

And before its asked.. Yes, I've converted the > and <'s to < and > just before its asked.
Don't hate Me cuz I'm beautiful.. I Can give you MUCH better reasons Than That....

Noone Likes A necro... till Mid-battle And They're OOM..

wrangler
a ghoul
a ghoul
Posts: 93
Joined: Fri Nov 28, 2003 3:07 pm

Post by wrangler » Wed Aug 04, 2004 9:35 am

nice, thanks
been trying to alter the ranger hunter macro to do something like this

will try it out when i get home

nbjeter3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Jan 21, 2004 12:18 am

anyone?

Post by nbjeter3 » Thu Aug 05, 2004 5:02 am

Was just curious if anyone has had a chance to take a look at the code and see if they can find a solution to my problem.. No hurry, just I'm Confuzzled...

Thanks
Don't hate Me cuz I'm beautiful.. I Can give you MUCH better reasons Than That....

Noone Likes A necro... till Mid-battle And They're OOM..

BigSol
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sat Apr 02, 2005 2:44 am

Annoying

Post by BigSol » Sat Apr 02, 2005 2:45 am

People like this drive me insane...

TEST YOUR MACROS before you post them here. This one is bugged and cannot set variables. What, did you just write it in notepad and upload it without even testing it?!

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

Re: Annoying

Post by JimJohnson » Sat Apr 02, 2005 3:55 am

BigSol wrote:People like this drive me insane...

TEST YOUR MACROS before you post them here. This one is bugged and cannot set variables. What, did you just write it in notepad and upload it without even testing it?!
Free loafing fags like you who register just to bitch drive me crazy.

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Sat Apr 02, 2005 4:54 pm

fucktards that post broken macros drive me crazy.

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Sun Apr 03, 2005 3:36 am

Code: Select all

/varset fXLoc ${Me.X} 
/varset fYLoc ${Me.Y} 
need to declare those like this

Code: Select all

/declare AnchorX float outer 
/declare AnchorY float outer 
/declare startpoint int outer  
/declare fXLoc float outer
/declare fYLoc float outer  
but it s only a "check if am stuck" value so it wont solve the autosuicide rng from runnig i guess :twisted:

also

Code: Select all

#event GotHIT "Hit You For"
events have to be spelled prefectly with caps and stuff and if it s not the full sentence of the event you ll write it in "#*# bla bla bla #*#"

Code: Select all

#event GotHIT "#*#hits YOU for#*#"
now that work only for simple hit they can be kick bash slash crush gore claw etc etc

so

Code: Select all

#event GotHIT "#*#hits YOU for#*#" 
#event GotHIT "#*#slashes YOU for#*#" 
#event GotHIT "#*#crushes YOU for#*#" 
#event GotHIT "#*#bashes YOU for#*#" 
#event GotHIT "#*#kicks YOU for#*#" 
#event GotHIT "#*#smashes YOU for#*#" 
#event GotHIT "#*#mauls YOU for#*#" 
#event GotHIT "#*#gores YOU for#*#"
#event GotHIT "#*#pierces YOU for#*#"
#event GotHIT "#*#kicks YOU for#*#"
#event GotHIT "#*#bashes YOU for#*#"
and the sub of the event have to be same as event too

Code: Select all

Sub Event_GotHIT
and finaly the anchor (home) have to be declared once only and so add a loop to not return to sub main

Code: Select all

Sub Main

/declare AnchorX float outer 
/declare AnchorY float outer 
/declare startpoint int outer
/declare fXLoc float outer 0.0
/declare fYLoc float outer 0.0 

/varset AnchorX ${Me.X} 
/varset AnchorY ${Me.Y}

/echo Rangerautopull.mac 
:start  
   /cleanup 
   /doevents 
   /call MoveToAnchor 
   /delay 10            
   /call Tarnpc 
/goto  :start  
/return

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Sun Apr 03, 2005 5:24 am

well i was bored and decided to make it to work since it s just too far from fonctionnal.

Code: Select all

|  Rangerautopull.mac   v 0.1 alpha 

| Writen by Omper 

#include spellcast.inc 
#event GotHIT "#*#hits YOU for#*#" 
#event GotHIT "#*#slashes YOU for#*#" 
#event GotHIT "#*#crushes YOU for#*#" 
#event GotHIT "#*#bashes YOU for#*#" 
#event GotHIT "#*#kicks YOU for#*#" 
#event GotHIT "#*#smashes YOU for#*#" 
#event GotHIT "#*#mauls YOU for#*#" 
#event GotHIT "#*#gores YOU for#*#" 
#event GotHIT "#*#pierces YOU for#*#" 
#event GotHIT "#*#kicks YOU for#*#" 
#event GotHIT "#*#bashes YOU for#*#"  

Sub Main

/declare AnchorX float outer 
/declare AnchorY float outer 
/declare fXLoc float outer 0.0
/declare fYLoc float outer 0.0
/declare Agro outer FALSE 

/varset AnchorX ${Me.X} 
/varset AnchorY ${Me.Y}

/echo Rangerautopull.mac 
:start
   /doevents
   /delay 1s
   /if (${Agro}) /call combat  
   /if (!${Agro}) /cleanup
   /call MoveToAnchor 
   /doevents 
   /delay 10            
   /if (!${Agro}) /call Tarnpc 
/goto  :start  
/return 

Sub Tarnpc    

   /target npc radius 150 
   /delay 1s
   /doevents
   /if (${Target.ID}) /call Cast "snare"      

/return

Sub combat 
   /attack on 
   :Loop
      /doevents 
      /if (${Target.Distance}>17) { 
            /keypress forward    
            } 
            /if (${Target.Distance}<10) { 
            /keypress back hold 
            /timed 1 /keypress back 
            } 
            /face nolook fast 
            /delay 0 
            /if (!${Target.ID}) { 
            /varset Agro FALSE
            /goto :End 
            } else { 
         /goto :Loop 
         } 

:End 
/return

Sub Event_GotHIT 
/varset Agro TRUE    
   
/return 

Sub MoveToAnchor
    /if (${Math.Distance[${AnchorY},${AnchorX}]}<=12) /return 
    /declare iCount int local 

    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
    /varset iCount 0 

    /echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}. 

:AnchorMoveLoop  
    /delay 1 
    /doevents 
    /face nolook loc ${AnchorY},${AnchorX} 
    
    /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) { 
       /keypress forward hold 
   } else { 
       /keypress forward 
       /return 
    } 

    /if (${iCount}>2) { 
        /call Detectobst 
        /face nolook loc ${AnchorY},${AnchorX} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+1 
    /goto :AnchorMoveLoop 
/return 

Sub Detectobst 
    /delay 2 
    /if (${fXLoc}==${Me.X}) /if (${fYLoc}==${Me.Y}) /call Hitobst 
    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
/return 

Sub Hitobst 
    /keypress forward 
    /keypress back hold 
    
    /if (${Math.Rand[2]}) {    
        /delay 2s    
        /keypress back 
        /keypress right hold 
        /delay 8 
        /keypress right 
        
        /delay 2s 
        /keypress back 
        /keypress left hold 
        /delay 8 
        /keypress left 
    } 
    /delay 10 
    /keypress forward hold 
/return 
it does what it s supposed to and is imo simple enough to be a good start to learn macro language.

Glacier
orc pawn
orc pawn
Posts: 22
Joined: Mon Oct 11, 2004 12:07 pm

Post by Glacier » Mon Oct 10, 2005 9:08 pm

magictiger wrote:fucktards that post broken macros drive me crazy.
write your own, ya fuck. way to encourage sharing of macs, numb nuts.

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Tue Oct 11, 2005 7:09 am

Glacier wrote:
magictiger wrote:fucktards that post broken macros drive me crazy.
write your own, ya fuck. way to encourage sharing of macs, numb nuts.
I *DO* write my own. They work. This one did not.
and WTF is with bringing up a post that's been dead for 6 months just to bitch at me about it?

Glacier
orc pawn
orc pawn
Posts: 22
Joined: Mon Oct 11, 2004 12:07 pm

Post by Glacier » Wed Oct 12, 2005 3:19 pm

magictiger wrote:
Glacier wrote:
magictiger wrote:fucktards that post broken macros drive me crazy.
write your own, ya fuck. way to encourage sharing of macs, numb nuts.
I *DO* write my own. They work. This one did not.
and WTF is with bringing up a post that's been dead for 6 months just to bitch at me about it?
well, if you do write your own, why complain about someone wanting to share a mac?

doesn't seem all that productive nor does it encourage the dude who is at least TRYING to share. Your post just seemed amazingly toolish.

Slippery
a lesser mummy
a lesser mummy
Posts: 74
Joined: Fri Oct 15, 2004 4:45 pm

Re: Annoying

Post by Slippery » Wed Oct 12, 2005 3:54 pm

BigSol wrote:People like this drive me insane...

TEST YOUR MACROS before you post them here. This one is bugged and cannot set variables. What, did you just write it in notepad and upload it without even testing it?!

:EDIT:
lol who bumped this thread?