Wandering Macro

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

ImaNoob
a ghoul
a ghoul
Posts: 89
Joined: Mon Mar 08, 2004 4:37 am

Wandering Macro

Post by ImaNoob » Fri Mar 12, 2004 5:22 am

I think it would be cool to see a macro that makes you wander around the zone aimlessly until you get to a destination.

Heres how I would like to see it done...

/macro wanderto targetname

In psuedo code I think it would have to go something like this.

Begin Loop end when x,y < tx-5 & ty-5
Select self and get x,y
Select Target get tx,ty

|I'm assuming this would cause you to take a minimum of 50 steps

newx = x-tx + rand(50);
newy = y-ty + rand(50);
goto location newx,newy

Loop to beginning

What do you think am I on the right track? I realize none of the words used above are actually in MQ2s macro language. but other than that are there any flaws in my logic here?

flightrecorder
a lesser mummy
a lesser mummy
Posts: 50
Joined: Mon Dec 22, 2003 10:06 am
Location: Sydney

Post by flightrecorder » Fri Mar 12, 2004 6:40 am

I'm thinking that you may have a prob in perhaps not being guarenteed of ever getting to your target.

The section:
newx = x-tx + rand(50);
newy = y-ty + rand(50);
goto location newx,newy
would have to have more smarts to eventually get you closer otherwise you'd walk randomly "forever" in some situations

Also, you'd have to generate relative values relating to your x, y distance and also direction from target to work with.
In the first instance, using absolute values you would occassionalyy get something like MyX(250) - TargX(-100) + Rand(50){say 35} = newx(385)
ie your moving away from target in direction x.

Then again, this maybe what you want to do...?
With knowledge comes power....so RTFM

ImaNoob
a ghoul
a ghoul
Posts: 89
Joined: Mon Mar 08, 2004 4:37 am

Remember when?

Post by ImaNoob » Fri Mar 12, 2004 10:45 pm

Remeber back before Yekesha gave us maps, how you could wander aimlessly through a zone for like 10 minutes before you got your bearings and headed for your target?

Yeah, thats the ticket! :)