• 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 - Vishimtar the Fallen Event Lua -- HELP Please? :)

Joined
Dec 17, 2016
RedCents
270¢
I took the Macro Czarman made here:
and I'm modifying it to be a Lua so that it can be run in tandem with existing macro / plugins. The current plan is to just run the toons with Blunt weapons and not worry about swapping at this time. Later after I get it working, I'm planning on using a bandolier so that players can just make a common bando and use it across all their toons.

It's not working correctly at the moment and if anyone would like to correct my mistakes, I would greatly appreciate it. I'm way too tired at the moment to see what I'm doing wrong. I'll pick it back up tomorrow.

Thanks Knightly and Lemons for the code samples.

[CODE lang="Lua" title="Vish.Lua"]local mq = require('mq')

local CureDoom = function ()
if mq.TLO.Me.Buff(Creeping Doom)() ~= nil then return end
mq.cmd('/boxr pause')
if mq.TLO.Me.Sitting() then
mq.cmd('/stand')
end
::NavToCloud::
mq.cmd('/nav id ${NearestSpawn[${Math.Rand[${SpawnCount["mournful spirit"]}]},"mournful spirit"].ID} | dist=10')
while mq.TLO.Nav.Active() do mq.delay(1) end
mq.cmd('/target id ${NearestSpawn[npc "mournful spirit"].ID}')
mq.delay(5)
if mq.TLO.Target.Distance() < 20 then
mq.cmd('/say Shoulder My Burden')
mq.cmd('/boxr unpause')
else
goto NavToCloud
end
end
end

local KillEggs = function ()
if mq.TLO.Me.Buff('Creeping Doom')() == nil and mq.TLO.Spawn('npc "a tainted egg"')() ~= nil then return end
mq.cmd('/boxr pause')
mq.cmd('/nav id ${Spawn[npc "a tainted egg"].ID}')
mq.cmd('/target id ${Spawn[npc "a tainted egg"].ID}')
::Kill_Egg::
if mq.TLO.Me.Combat() and mq.TLO.Target.Distance() < mq.TLO.Target.MaxRangeTo() then
mq.cmd('/attack on')
end
mq.cmd('/delay 3')
local myTarget = mq.TLO.Target()
if myTarget ~= nil and myTarget.CleanName() == 'a tainted egg'then
goto Kill_Egg
mq.cmd('/boxr unpause')
end
end


while true do
CureDoom()
mq.delay(10)

KillEggs()
mq.delay(10)
end
end[/CODE]
 
Lua:
local mq = require('mq')

local function cure_doom()
    if mq.TLO.Me.Buff('Creeping Doom').ID() then
        mq.cmd('/boxr pause')
        -- stand up
        if mq.TLO.Me.Sitting() then mq.cmd('/stand') end

        local spawn_search = 'npc mournful spirit'
        while mq.TLO.SpawnCount(spawn_search)() do
            local spawn = mq.TLO.NearestSpawn(1, spawn_search)
            mq.cmdf('/nav id %s | dist=10', spawn.ID())

            -- wait while naving
            while mq.TLO.Nav.Active() do mq.delay(100) end
         
            -- target and say the phrase
            mq.cmdf('/target id %s', spawn.ID())
            mq.delay(2000, function() return mq.TLO.Target.ID() == spawn.ID() end)
            if spawn.Distance() < 20 then
                mq.cmd('/say Shoulder My Burden')
                mq.cmd('/boxr unpause')
            end -- changed this from else, oops
        end
    end
end

local function kill_eggs()
    local spawn = mq.TLO.Spawn('npc a tainted egg')
    if mq.TLO.Me.Buff('Creeping Doom').ID() and spawn.ID() then
        mq.cmd('/boxr pause')
     
        -- run nav and wait
        mq.cmdf('/nav id %s | dist=10', spawn.ID())
        while mq.TLO.Navigation.Active() do mq.delay(100) end

        -- target spawn
        mq.cmdf('/target id %s', spawn.ID())
        mq.delay(2000, function() return mq.TLO.Target.ID() == spawn.ID()) end)

        while spawn.ID() do
            if not mq.TLO.Me.Combat() and mq.TLO.Target.Distance() < mq.TLO.Target.MaxRangeTo() then
                mq.cmd('/attack on')
            end
            mq.delay(500)
        end

        mq.cmd('/boxr unpause')
    end
end

while true do
    cure_doom()
    kill_eggs()
    mq.delay(500)
end
 
Last edited:
Awesome! I haven't tested but I have faith it works. I should have elaborated last night a little more. The reason for the [CODE title="Random Spawn Search"] mq.cmd('/nav id ${NearestSpawn[${Math.Rand[${SpawnCount["mournful spirit"]}]},"mournful spirit"].ID} | dist=10')[/CODE] was to hopefully keep the 4 toons that are debuffed from targeting and running to the same spirit. What would that look like with your updated code? :) If your code does do this and I just miss understood my appolologies.

Also, we don't want to be killing eggs if we have the Creeping Doom so I added back the nil.
Code:
  == nil

The fight mechanics are at the beginning of the fight, egg sacks spawn and you have to kill them before a drake hatches out of them. Blunt weapons are the only thing that really damage the eggs. While you are killing Vish you want to pull off and kill the eggs then get back on Vish. Then some other mechanics come into play until you get to 25%. At that point Vish starts casting Doom on 4 char's in the raid and they have ~48sec to run to a spirit and get cured. Each spirit only cures 1 toon. So when the 4 toons get the debuff each need to run to a different spirit. If by chance each toon runs to the same spirit, the 2nd one needs to find another spirit and run to it for a cure. The one thing I could never figure out is if a toon was running to a spirit and it poofed while traveling I would like them to redirect to another spirit.

**edit**
I also noticed you took out the loop for running to the spirit. I had the loop in there so that in the event someone beats you to the spirit and you are trying to get a cure the toon would run to the next spirit to get a cure hopefully. It 'should' of looped until it got a cure or died.

Ultimately the script needs to run for the entire event and not stop until it crashes (hope not) or the player ends it.
 
Last edited:
Latest untested script. Keep in mind that you need blunt weapons to be effective at killing the eggs. I may make two different Lua scripts after some testing so that only the boxes you want killing eggs go while the remaining stay on Vish.


[CODE lang="Lua" title="Vish.Lua"]
local mq = require('mq')
local function cure_doom()
if mq.TLO.Me.Buff('Creeping Doom').ID() then
mq.cmd('/boxr pause')
-- stand up
if mq.TLO.Me.Sitting() then mq.cmd('/stand') end
--Find a random Spirit hopefully not the same as the other 4 toons with Doom
local spawn_search = 'npc mournful spirit'
while mq.TLO.SpawnCount(spawn_search)() > 0 do
local i = math.Random(mq.TLO.SpawnCount(spawn_search)())
local spawn = mq.TLO.NearestSpawn(i, spawn_search)
-- wait while naving
while mq.TLO.Nav.Active() do mq.delay(100) end

-- target and say the phrase
mq.cmdf('/target id %s', spawn.ID())
mq.delay(2000, function() return mq.TLO.Target.ID() == spawn.ID() end)
local distance = mq.TLO.Target.Distance()
if distance and distance < 20 then
mq.cmd('/say Shoulder My Burden')
mq.cmd('/boxr unpause')
end
end
end
end
local function kill_eggs()
local spawn = mq.TLO.Spawn('a tainted egg')
--If I don't have Doom and there are eggs up
local tEggscludedClasses = { CLR = true, DRU = true, SHM = true }
if tEggscludedClasses[mq.TLO.Me.Class.ShortName()] == nil and not mq.TLO.Me.Buff('Creeping Doom')() and spawn.ID() > 0 then
mq.cmd('/boxr pause')

-- run nav and wait
mq.cmdf('/nav id %s | dist=10', spawn.ID())
while mq.TLO.Navigation.Active() do mq.delay(100) end
-- target spawn
mq.cmdf('/target id %s', spawn.ID())
mq.delay(2000, function() return mq.TLO.Target.ID() == spawn.ID() end)
while spawn() do
if not mq.TLO.Me.Combat() and mq.TLO.Target.Distance() < mq.TLO.Target.MaxRangeTo() then
mq.cmd('/attack on')
end
mq.delay(500)
end
mq.cmd('/boxr unpause')
end
end
while true do
cure_doom()
kill_eggs()
mq.delay(500)
end
[/CODE]
 
Last edited:
Line 40: Attempts to compare two nil values. Also, while the corpse of the egg is still around, it will nav you back to them.

After eggs die, while nothing up.
 
Line 40: Attempts to compare two nil values. Also, while the corpse of the egg is still around, it will nav you back to them.

After eggs die, while nothing up.
Yeah haven’t had a chance a chance to work on it since the last update. I found out that it never leaves the egg because it still has a target. Any fixes are welcome. I’m by no means a Lua script writer. I’ve begged, borrowed, and stole what’s here 😂
 
Line 40 might check that you actually have a target.
Code:
if mq.TLO.Target() ~= nil and not mq.TLO.Me.Combat() and mq.TLO.Target.Distance() < mq.TLO.Target.MaxRangeTo() then
 
Yeah haven’t had a chance a chance to work on it since the last update. I found out that it never leaves the egg because it still has a target. Any fixes are welcome. I’m by no means a lua script writer. I’ve begged, borrowed, and stole what’s here 😂
Would turning on /hidec always on hide the corpse or would it still be visible because it is being targetted?
 
Would turning on /hidec always on hide the corpse or would it still be visible because it is being targetted?
Normal functionality in game is that any corpse, either targeted or not would disappear once the hide command is issued.
 
I added a /hidec always command in the egg part and that seems to work well now. The local i = math.Random(mq.TLO.SpawnCount(spawn_search)()) part seems to be broken. I attached the errors that showed up in the mq2 window.
 

Attachments

  • vish error.PNG
    vish error.PNG
    32.3 KB · Views: 33
Lua - Vishimtar the Fallen Event Lua -- HELP Please? :)

Users who are viewing this thread

Back
Top
Cart