Basic assist macro

Villageidiot

Captain Douchebag
Joined
Jan 4, 2005
Messages
3,198
Reaction score
7
Points
0
This is a basic assist macro that assist the person designated and returns to camp. Camp would be the spot the macro is started.

haven't tested a bunch yet. but i notice when posting things like this people will take it and roll with it. Making it better and better. Just trying to help

Code:
|	Standard Melee assist Macro.  Scrapped together by Villageidiot
|
|
|	This macro will assist whoever is designated
|	and will return to starting point after mob
|	dies.
|
|	Usage: /mac assist (char's name your assisting)
|
|
|	This has been mainly scrapped together from a few
|	different macro's.  I do not take full credit for
|	this macro but through it together and decided to
|	share this with everyone.




Sub Main
/if (!${Defined[Param0]}) {
  /echo Proper usage: /macro assist TankName
  /end
}

   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y}
   /declare AssistGuy string outer ${Param0}

:Loop
 /if (${Zone.ShortName.Equal[GuildLobby]}) {
	/sit
	/endmac
}
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 1s
			/assist ${AssistGuy}
}
 /if (!${Target.ID})  			/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
	
 /delay 3s

/goto :Loop

/return



Sub MoveToLoc(MoveToY, MoveToX) 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation  
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /keypress forward 
         /return 
      } 
      /if (${distanceTimer}==0) { 
         /if (${Me.Sneaking}) { 
            /varset distanceModifier 2 
         } else { 
            /varset distanceModifier 1 
         } 
         /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) { 
         /call HitObstacle 
         } 
         /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /varset distanceTimer 15 
      } 
      /if (${running}==0) { 
         /keypress forward 
            /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return

Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return
 

Attachments

  • assist.mac
    3 KB · Views: 580
Looking through that , am i right in assuming you need autoattack on, so you attack on assist?
 
if you have /assist on, which turns attack on automatically when assisting. You should be good to go. Also have mq2melee going and moveutils, so you will stick to them.
 
nope, it waits until they are closer to the camp spot. before it will take off towards the mob.
 
if this had some of Nils assist at mobs %hp then I guess you would need an .ini of that? I thought that I might be able to find the code for it, but I know nothing about coding and I just dont have knowledge of where to start.

I would love to use this on my monk but I dont like to attack with other characters until the mob in camp is at 98% hp. by the time that I get the mob to 98% with the warrior then I have a ton of agro and not even the ranger chain casting fire dd's can pull if off the tank.
 
Code:
Sub Main
/if (!${Defined[Param0]}) {
  /echo Proper usage: /macro assist TankName
  /end
}

   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y}
   /declare AssistGuy string outer ${Param0}

:Loop
 /if (${Zone.ShortName.Equal[GuildLobby]}) {
	/sit
	/endmac
}
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 15s  (${Target.PctHPs}<98)
			/assist ${AssistGuy}
}
 /if (!${Target.ID})  			/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
	
 /delay 3s

/goto :Loop

/return



Sub MoveToLoc(MoveToY, MoveToX) 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation  
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /keypress forward 
         /return 
      } 
      /if (${distanceTimer}==0) { 
         /if (${Me.Sneaking}) { 
            /varset distanceModifier 2 
         } else { 
            /varset distanceModifier 1 
         } 
         /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) { 
         /call HitObstacle 
         } 
         /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /varset distanceTimer 15 
      } 
      /if (${running}==0) { 
         /keypress forward 
            /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return

Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return

This might work, i added a delay before assisting
 
dont work

with this macro wich i love very much i still also have the same problem.
my warrior goes rushing in before the mob is even in the camp, causing agro problems.
 
Code:
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 15s  (${Target.PctHPs}<98)
			/assist ${AssistGuy}
}

What is the point of the delay? Remove the delay. Have it assist assist then delay until Target.PctHPs is < 98 && Target.Distance<50
 
You are most likely running in because auto attack on assist is on. Add the Bold line into the code to shut it off when the macro starts.

Code:
Sub Main
[B][COLOR="Red"]/squelch /assist off[/COLOR][/B]
/if (!${Defined[Param0]}) {
  /echo Proper usage: /macro assist TankName
  /end
}

   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y}
   /declare AssistGuy string outer ${Param0}

:Loop
 /if (${Zone.ShortName.Equal[GuildLobby]}) {
	/sit
	/endmac
}
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 15s  (${Target.PctHPs}<98)
			/assist ${AssistGuy}
}
 /if (!${Target.ID})  			/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
	
 /delay 3s

/goto :Loop

/return



Sub MoveToLoc(MoveToY, MoveToX) 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation  
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /keypress forward 
         /return 
      } 
      /if (${distanceTimer}==0) { 
         /if (${Me.Sneaking}) { 
            /varset distanceModifier 2 
         } else { 
            /varset distanceModifier 1 
         } 
         /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) { 
         /call HitObstacle 
         } 
         /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /varset distanceTimer 15 
      } 
      /if (${running}==0) { 
         /keypress forward 
            /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return

Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return
 
well if you use that, your toon will target whoever the puller is pulling but never do anything. the /assist on part was what handled the moving to mob and actually attacking. /assist on triggered mq2melee/moveutils to kick in.
 
I suppose you could do this

Code:
Sub Main
/squelch /assist off
/if (!${Defined[Param0]}) {
  /echo Proper usage: /macro assist TankName
  /end
}

   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y}
   /declare AssistGuy string outer ${Param0}

:Loop
 /if (${Zone.ShortName.Equal[GuildLobby]}) {
	/sit
	/endmac
}
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
                                      /assist ${AssistGuy}
			/delay 15s  (${Target.PctHPs}<95)
			/attack on
}
 /if (!${Target.ID})  			/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
	
 /delay 3s

/goto :Loop

/return



Sub MoveToLoc(MoveToY, MoveToX) 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation  
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /keypress forward 
         /return 
      } 
      /if (${distanceTimer}==0) { 
         /if (${Me.Sneaking}) { 
            /varset distanceModifier 2 
         } else { 
            /varset distanceModifier 1 
         } 
         /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) { 
         /call HitObstacle 
         } 
         /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /varset distanceTimer 15 
      } 
      /if (${running}==0) { 
         /keypress forward 
            /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return

Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return
 
reading over it

Everything looks good in here, what if I don't want him to return to camp, what if I want him to /follow main person? I suppose there are tons of differnt ways that this particular macro could be used, I was actually thinking of makin something like this myself but it would have been a much simplier macro as I don't have the experiance with coding that you do.

perhaps you could help me by throwing something together for me real quick? An example of what i'm looking for is pretty simple.

would want something for ranger and chanter...ranger is pretty easy, looking to set something up for him to assist param0 where param0 is MA, wait about 3 seconds and snare until it sticks. mq2melee will do the rest. Apon completing killing of mob /follow param0

Enchanter would be /following param0 but would want her to auto assist when mob was within 30ish range but she would have /assist off, and would cast tash, slow, then cripple. best I know how to do that is /cast 1, /pause 25, /cast 2, /pause 45, /cast 3, but I don't know any code to cast till it sticks, already have sound setup so that it makes a noise when certain thing goes across chat (IE: sucessfull, ensnared, blah blah) but really lost on making something like this, any help would be appriciated
 
yay

Code:
 /if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 15s  (${Target.PctHPs}<98)
			/assist ${AssistGuy}
}

What is the point of the delay? Remove the delay. Have it assist assist then delay until Target.PctHPs is < 98 && Target.Distance<50

Thanks jim this worked for me, thats exactly what i needed.
 
how would the line of code look then if it was added to the assist macro to assist on the target being >98 health and 50 radius? I tried to add the code like JJ said but must have missed something in translation. Thank you for the help
 
Code:
|	Standard Melee assist Macro.  Scrapped together by Villageidiot
|
|
|	This macro will assist whoever is designated
|	and will return to starting point after mob
|	dies.
|
|	Usage: /mac assist (char's name your assisting)
|
|
|	This has been mainly scrapped together from a few
|	different macro's.  I do not take full credit for
|	this macro but through it together and decided to
|	share this with everyone.




Sub Main
/if (!${Defined[Param0]}) {
  /echo Proper usage: /macro assist TankName
  /end
}

   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y}
   /declare AssistGuy string outer ${Param0}

:Loop
 /if (${Zone.ShortName.Equal[GuildLobby]}) {
	/sit
	/endmac
}
/if (${Spawn[${AssistGuy}].Type.Equal[PC]} && ${Spawn[${AssistGuy} radius 100].ID}) {
			/delay 15s  (${Target.PctHPs}<98)
			/assist ${AssistGuy}
}
 /if (!${Target.ID})  			/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
	
 /delay 3s

/goto :Loop

/return



Sub MoveToLoc(MoveToY, MoveToX) 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation  
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /keypress forward 
         /return 
      } 
      /if (${distanceTimer}==0) { 
         /if (${Me.Sneaking}) { 
            /varset distanceModifier 2 
         } else { 
            /varset distanceModifier 1 
         } 
         /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) { 
         /call HitObstacle 
         } 
         /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
         /varset distanceTimer 15 
      } 
      /if (${running}==0) { 
         /keypress forward 
            /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return

Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return

changed it but i dont tried but think must be working
 
thank you Maces, but I didnt see where the radius was added. I'm trying to learn basic macro reading so I dont have to ask so many questions is all. Since I've ran into a problem with rogue helper stop assisting the MA after so many mobs, I figured just a basic assist macro would suffice even without using the discs that rogue helper allows for. So, basically, any assist mac that would assist a tank when a mob is at 96-98% health and within a certain radius would most likely work.
 
Assist Code

Code:
Sub AssistFast(int ID)
   /if ( !${Spawn[ID ${ID}].ID} ) /return 0
   /target ID ${Me.ID}
   /delay 1s ( ${Me.TargetOfTarget.ID}==${Me.ID} )
   /if ( ${Me.TargetOfTarget.ID}==${Me.ID} ) {
      /target ID ${ID}
      /delay 3s ( ${Me.TargetOfTarget.ID}!=${Me.ID} || !${Me.TargetOfTarget.ID} )
      /return ${Me.TargetOfTarget.ID}
   } else {
      /target ID ${ID}
      /assist
      /delay 3s ( !${Target.ID} || ${Target.ID}!=${ID} )
      /return ${Target.ID}

   }
/return 0
 
Using Village's last posted code and I'm still attacking at 100% when MA targets a mob. I even make sure I have /assist off, not sure what's up.