• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

Question - LUA calling sub in macro (1 Viewer)

May 30, 2015
Is it possible to have a Lua call a sub routine in a macro? ie

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

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

vs how i did it in a macro

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

sub Event_TellChat(ChatMessage, ChatSender, ChatText)
     /call SomethingCool


Jun 28, 2014
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.

Users who are viewing this thread