• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Request - trying to learn Lua

So I am trying to learn to write Lua's and starting very basic, cant seem to make this work anyone able to point me in right direction?
Wave
Lua:
local mq = require('mq')

local function condition()
    -- Optional: Only run if Banker Denton exists in zone
    return mq.TLO.SpawnCount('Banker Denton npc')() > 0
end

local function action()
    local targetName = mq.TLO.Target.Name()
    if targetName and targetName == 'Banker Denton' then
        mq.cmdf('/wave')
    end
end

return {condfunc=condition, actionfunc=action}

ok i was able to make that one work thanks

Wave
Lua:
local mq = require('mq')

local function condition()
    return mq.TLO.SpawnCount('Banker Denton')() > 0
end

local function action()

    if mq.TLO.Target.CleanName() == 'Banker Denton' then
        mq.cmd('/wave')
 
    end

end
{condfunc=condition, actionfunc=action}
 
Last edited:
if you click this button 1751828798363.png when editing your post oyu can paste code into a code block so its nice looking, can even select it to be Lua code so its nicely formatted.
 
So I am trying to learn to write Lua's and starting very basic, cant seem to make this work anyone able to point me in right direction?



local mq = require('mq')
local library = require('library')

---@return boolean @Returns true if the action should fire, otherwise false.
local function condition()
local target = mq.TLO.Me.Target()
-- Check if target exists, is an NPC, and the name matches "Banker Denton"
return target() ~= nil
and target.Type() == "NPC"
and target.Name() == "Banker Denton"
and library.in_control()
end

local function action()
Write.Debug('ENTER action')
Write.Info('Waving at Banker Denton')
mq.cmd('/wave')
end

return {condfunc=condition, actionfunc=action}
Didn't look at everything, but your target variable is defined as a string, and you are trying to make it string again by adding more parentheses.
You can't add a member to a string. E.g, you can't have mq.TLO.Target().Name(). Its just mq.TLO.Target.Name()
Drop them where you defined target.
local target = mq.TLO.Target
Also, drop the Me
 
Anyone got any recommendations on a resource for writing conditional scripts for events that you need to cure, dodge, or run away from a mob? I've tried and either its very hard to test or they don't work. I can write the non conditional ones pretty well.
 
Last edited:
Anyone got any recommendations on a resource for righting conditional scripts for events that you need to cure, dodge, or run away from a mob? I've tried and either its very hard to test or they don't work. I can write the non conditional ones pretty well.
LEM examples are probably a good place to start - it really depends on what all you're trying to do.

when i approach something i usually start with "how would a real person do this"

so if it is a "would look for the buff" or "trigger goes off saying i got the buff / emote"

then i would say "how do i make mq look for the buff or react to a trigger/emote"
 
LEM examples are probably a good place to start - it really depends on what all you're trying to do.

when i approach something i usually start with "how would a real person do this"

so if it is a "would look for the buff" or "trigger goes off saying i got the buff / emote"

then i would say "how do i make mq look for the buff or react to a trigger/emote"
Thanks I'll start there and see if I get something going.
 
I do the same thing. Especially when I am trying to program raid events, I will start with a shell, put in the events, having it write messages to the window so I can see exactly what is firing and when. Once I am seeing that it is reacting to the events, I will then start putting in the actions it is supposed to take to handle the events.

It is really an iterative process.
 
I don't see that on mine ... do I need to do anything to expand it?

mod edit: i deleted your picture - you have a bunch of names in the background.
 
Btw if you still want command line you can /lua run mq/eval
Typically faster than going for the clicky stuff for me, but to each their own
 
Request - trying to learn Lua

Users who are viewing this thread

Back
Top
Cart