Moderator: MacroQuest Developers

Code: Select all
/keypress forward hold
/varset CircleHeading ${Math.Calc[${Heading [<the y loc you want>,<the x loc you want>].Degrees}+90]}
/face heading ${CircleHeading}
Code: Select all
Sub Main(p1,p2)
/declare x float outer
/declare y float outer
/varset x ${p1}
/varset y ${p2}
if (${Target.Distance}<60) {
/keypress forward hold
/varset CircleHeading ${Math.Calc[${Heading [<x>,<y>].Degrees +90]}
/face heading ${CircleHeading}
}
/endmacroNot quite. The ${Math.Calc[${Heading [<x>,<y>].Degrees +90]} returns a heading that is the heading to the centre of your circle +90 (putting -90 faces you the other direction). YOud probably be best passing in the y x and distance to your sub, then check you distance and vary the +90 by a few degrees to compensate.imbald wrote:Code: Select all
Sub Main(p1,p2) /declare x float outer /declare y float outer /varset x ${p1} /varset y ${p2} if (${Target.Distance}<60) { /keypress forward hold /varset CircleHeading ${Math.Calc[${Heading [<x>,<y>].Degrees +90]} /face heading ${CircleHeading} } /endmacro
So Somthing like that? or does .Degrees beed a definiton[/code]
Code: Select all
sub circle(float PointX,float PointY,float Radius)
/declare skew float inner 90
/if (${Math.Distance[${PointY},${PointX}]}>${Radius}) /varset skew 92
/if (${Math.Distance[${PointY},${PointX}]}<${Radius}) /varset skew 88
/face heading ${Math.Calc[${Heading [<x>,<y>].Degrees+${Skew}]}
/return
