• 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

Lua - Colored Circle Fun!

Coldblooded

Zero Fuchs Given
Creator
Joined
Mar 23, 2019
RedCents
8,961¢
Pronouns
He/Him
A fun Sunday morning project

This is set up for a mage to summon and drop items on the ground in a circle using some basic math and mq2nav.

Certain mage items glow/flash different colors, so for sure have fun finding new ones. If you do, please let us know! Who knows, maybe this could be a fun time waster.
I found that Heatstones glow red, Coldstones glow blue, and Orb of Exploration are yellow color.

How to use
Put this script in your Lua folder, break out that old mage and make sure you mem the spells. If you don't have the spells memed, the script will complain about it and quit.
By default, it will make a 10-unit radius circle with 10 items with a blue-colored item.

You can pass in arguments to control the outcome.
Argument 1 is the number of items to distribute along the circle.
Argument 2 is the size of the circle in EQ units.
[BGCOLOR=initial]Argument 3 is the color of the items.[/BGCOLOR]

/lua run circles 20 20 red

Have FUN!

[CODE lang="Lua" title="circle.Lua"]---@type Mq
local mq = require('mq')

local args = {...}

local radian_in_circle = 6.28
local items = args[1] or 20
local increment = radian_in_circle/items

local r = args[2] or 15
local Cx = mq.TLO.Me.X()
local Cy = mq.TLO.Me.Y()

local item_color = {
blue = 'summon coldstone',
red = 'summon heatstone',
yellow = 'summon: orb of exploration'
}

local color = args[3] or 'blue'

print('Using item color '..color)
print('Casting: '..item_color[color])

if mq.TLO.Me.Gem(item_color[color]) == nil then
print('You need to memorize '..item_color[color]..' to continue.')
mq.exit()
end

for i = 0, radian_in_circle, increment do

-- Move to our location
local x = Cx + (r * math.cos(i))
local y = Cy + (r * math.sin(i))
mq.cmdf('/squelch /nav locxy %d %d', x, y)
repeat mq.delay(250) until not mq.TLO.Navigation.Active()

-- Cast our item. Recast if necessary from fizzles or other issues.
while not mq.TLO.Cursor() do
-- Check to see if our spell is ready to cast and if not wait for it
repeat mq.delay(250) until mq.TLO.Me.SpellReady(string.format('%s', item_color[color]))()
mq.cmdf('/cast "%s"', item_color[color])
repeat mq.delay(250) until not mq.TLO.Me.Casting()
end

-- Drop the item on the ground
mq.cmd('/drop')
repeat mq.delay(250) until not mq.TLO.Cursor()

end

-- Move back to to the center of our circle when complete
mq.cmdf('/squelch /nav locxy %d %d', Cx, Cy)[/CODE]



[ICODE][/ICODE]
 
Last edited:
Lua - Colored Circle Fun!

Users who are viewing this thread

Back
Top
Cart