• 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

Question - LUA calling sub in macro

Is it possible to have a Lua call a sub routine in a macro? ie

Code:
local function EVT_TellChat(CompLine, ChatSender, ChatText)
     /call SomethingCool

end
mq.event('TellChat', "#1# tells you, '#2#'", EVT_TellChat)

vs how i did it in a macro

Code:
#Event TellChat        "#1# tells you, #2#"

sub Event_TellChat(ChatMessage, ChatSender, ChatText)
     /call SomethingCool
/return
 
For Lua you would just directly call the function (you don't need /call since it's a function).

But if you're asking if you can use a Lua event to call the MACRO's function the answer is a hard maybe. You MIGHT be able use mq.cmd to call the sub, but you'll likely have mixed results since you're calling it "out of band" from the macro if it works at all. Either way, I wouldn't do it that way. Without upsetting flow control in the macro you could also set a variable and have your macro determine it's time to call that function. Or you could create a bind in your macro and have Lua execute the bind (or any other number of ways).

The better answer, regardless, is to port that function you're calling to Lua and just call it direct.
 
Question - LUA calling sub in macro

Users who are viewing this thread

Back
Top
Cart