• 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? Change the look. To dismiss this notice, click the X --->

Question - LUA calling sub in macro (1 Viewer)

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

INI:
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

INI:
#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