• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

MQ2SafeSpot

Joined
Sep 12, 2004
RedCents
17,245¢
I wrote this little plugin to find a safe spot (out of mob melee range) within an area. I think it would be useful for getting automated pet tanking to work. It uses a simple Voronoi diagram creator (just used the source from http://skynet.ie/~sos/mapviewer/voronoi.php, which is free to use) based on a list of mobs locations in range, and then uses a quad-tree to sort through the vertices and find one that is far enough away from mobs to be safe. It would be awesome if more people tested this to make sure it works really well. Here's what to expect:

You MUST use this first, or you won't have a zone to kill in.
Rich (BB code):
/setKillZone <radius #> <loc # #> <safe #> <min #> <inc #>

will set up the zone in which you want to check and find safe spots. Radius is the size of the zone (defaults to 25), loc is the X Y of the center (defaults to your current position -- also I might have these backwards from ingame /loc), safe is an overestimate of max melee range (default is 5, that might be low), min is the minimum distance to check for mobs from a vertex (defaults to 0.5), and inc is how much you want to increment your nearest mob search (defaults to 1 -- the higher this is the faster the algorithm, but the coarser and less accurate the result)

Then you just run this command:
Rich (BB code):
/findSafeSpot
will find a safe spot and populate the new TLO's:

Rich (BB code):
${SafeSpot} - gives human readable loc.
${SafeSpot.X} - gives a float for x position
${SafeSpot.Y} - gives a float for y position
${SafeSpot.SafeDist} - gives the safe distance
${SafeSpot.MinDist} - gives the min distance
${SafeSpot.IncDist} - gives the increment

That's pretty much it. I hope you macro writers out there find this useful and help me develop it more. I wrote this in a day, so I expect bugs -- please help me find them!
 

Attachments

Okay, for a proof of concept I threw together a little macro that will simply set up the safe spot, find a spot when necessary, and then move to it. Not the most robust mac, but it certainly tests the core functionality well. So I'm putting it here hoping that someone will find it useful and give me some feedback =D.

Now to get my team to pull, mez, break mez, and all move to safe spots automatically...

Rich (BB code):
#turbo 40

#Event  GotHit          "#*# YOU for#*#points of damage."
#Event  Zoned           "LOADING, PLEASE WAIT#*#"

Sub Main
	/plugin MQ2SafeSpot
	/plugin MQ2MoveUtils
	
	/declare CampRadius float outer 25
	/declare CampX float outer ${Me.X}
	/declare CampY float outer ${Me.Y}
	/declare SafeDist float outer 5
	/declare MinDist float outer 0.5
	/declare IncDist float outer 1
	
	/setKillZone radius ${CampRadius} loc ${CampX} ${CampY} safe ${SafeDist} min ${MinDist} inc ${IncDist}
	
	:MainLoop
		/doevents
		
		| Check if I have aggro (assumes XTargets are all Auto Aggro), make sure I'm in my camp that I set up before, make sure I'm not already standing on a safe spot, and make sure that my first target is in the camp
        /if (${Me.XTarget} > 0 && ${Math.Distance[${CampY},${CampX}]} <= ${CampRadius} && ${Math.Distance[${SafeSpot.Y},${SafeSpot.X}]} > ${MinDist} && ${Math.Distance[${Spawn[${Me.XTarget[1].ID}].Y},${Spawn[${Me.XTarget[1].ID}].X}]} <= ${CampRadius}) {
            /findSafeSpot
			/moveto mdist 1
			/moveto loc ${SafeSpot.Y} ${SafeSpot.X}
			/delay 250 ${MoveTo.Stopped}
        }
	/goto :MainLoop
/return

| ----------------------------------------------------------------------------
| SUB: Event GotHit
| ----------------------------------------------------------------------------
    Sub Event_GotHit
		/findSafeSpot
		/moveto mdist 10
		/moveto loc ${SafeSpot.Y} ${SafeSpot.X}
		/delay 250 ${MoveTo.Stopped}
    /return
| ----------------------------------------------------------------------------
| SUB: Event Zoned
| ----------------------------------------------------------------------------
    Sub Event_Zoned(Message)
		/endmac
    /return
 
MQ2SafeSpot

Users who are viewing this thread

Back
Top
Cart