Page 1 of 1

Bard Circle

Posted: Wed Aug 11, 2004 10:32 am
by imbald
i was looking at alot of the bard twists and such last night, since
i just found out about this nifty thing, well i see all this complected
stuff and i was wonder if this would work to make a circle, not a
perfect circle but none the less =)

/if (${Me.Speed}&<;0} /keypress Num_Lock
/if (${Target.Distance}&<;45) /keypress right hold
/if (${Target.Distance}&>;55) /keypress left hold


Probly really stupied question sorry =(
BTW i love the Programming, reminds me of Vb without the forms
and isn't complicated like c++ =) Very nice!

Posted: Wed Aug 11, 2004 12:13 pm
by aChallenged1
I don't believe you will get a circle at all out of this, more like a forward moving zigzag.

Another option would be to have it change between run and walk to keep it within distance. Just a thought I'm throwing out.

Posted: Wed Aug 11, 2004 12:39 pm
by Cr4zyb4rd
The last thing I want to do is trod on the does of anybody who wants to learn to make their own macros, but you're kind of trying to re-invent the wheel here a little bit. The MQ2MoveUtils plugin has an excellent implementation of a /circle command that can circle in a given radius, circle on a targetted mob, etc...it even comes with an option to make the movement more "jerky" and less automated-looking. If you were able to get MQ itself compiled, the plugin should be a no-brainer.

If you're truely dedicated to do-it-yourselfing this, or just want to learn, I'l point out that common practice for any type of movement commands is to /keypress hold for a short duration (using /delay) and then check some conditions and start again in a loop...doing otherwise almost guarentees that you'll "shoot off into the sunset" under some circumstances. /keypres num_lock is almost ALWAYS a no-no.

Posted: Wed Aug 11, 2004 2:55 pm
by imbald
Where cna i find this plugin, and i know num_lock ant the best
but the other if stats ment keep u at a sertain distance

Posted: Wed Aug 11, 2004 2:58 pm
by Cr4zyb4rd
Dunno man. There should be various easy ways to find things that people post on these boards, but there just aren't. You're S.O.L.

Posted: Wed Aug 11, 2004 3:08 pm
by Zazoot

Posted: Wed Aug 11, 2004 5:29 pm
by Fippy
A good way to run in a circle is to loop around something like this

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}

lag will make you waver a bit so you'll want to vary the +90 occasionaly to keep you at a certain distance.

Posted: Thu Aug 12, 2004 1:08 am
by imbald

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]

Posted: Thu Aug 12, 2004 6:02 am
by Fippy
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]
Not 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.

Something like this maybe

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
and call it in your main movement loop. You will have to fiddle with the skew number a bit and maybe do .DegreesCCW instead of just .Degrees and the distance checks might be the wrong way around.

It might be an idea to vary the skew by the amount your distance is off so you get back on track better.

Id advide you to look at the readme.chm that comes with the MQ-Latest.zip and see what each of these funtion do whilst you play with the script.

Posted: Fri Aug 13, 2004 4:27 pm
by nightfall154
imbald wrote:Where cna i find this plugin, and i know num_lock ant the best
but the other if stats ment keep u at a sertain distance
Uhm, have you checked the plugin forum? In fact, it's on the first page...within the ten first topics. It's amazing what one can accomplish with a bit of effort.