Skip to content

Commit

Permalink
v1.03
Browse files Browse the repository at this point in the history
* Added command arguments when loading.
   * /lua run sast solo
   * runs in solo mode and doesn't sent group commands to close windows.
   * /lua run sast eqbc
   * checks and loads EQBC then uses /bcca / commands.
   * /lua run sast dannet
   * checks and loads DanNet then uses /dgae  commands.
  • Loading branch information
grimmier378 committed Mar 8, 2024
1 parent 6be0e1f commit ee7a0f7
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions init.lua
Expand Up @@ -18,6 +18,7 @@ local AdvWIN = mq.TLO.Window('AdventureRequestWnd')
local guiOpen = false
local eqWinOpen = false
local groupCmd = '/dgae '
local mode = 'DanNet'
--Helpers
local function checkAdv()
-- check for active adventure timers.Either time to enter dungeon or time to complete.
Expand Down Expand Up @@ -71,9 +72,26 @@ function GUI_AdvStatus(open)
end
end

local arg = {...}
if arg[1] and arg[1] == 'solo' then mode = 'Solo' end
if arg[1] and arg[1] == 'dannet' then mode = 'DanNet' end
if arg[1] and arg[1] == 'eqbc' then mode = 'EQBC' end

local function startup()
--check for MQ2EQBC plugin
if mq.TLO.Plugin('mq2eqbc').IsLoaded() then groupCmd = '/bcaa /' end
if mode == 'EQBC' then
if not mq.TLO.Plugin('mq2eqbc').IsLoaded() then
print('EQBC Not Loaded... Loading EQBC...')
mq.cmd('/plugin eqbc')
end
groupCmd = '/bcaa /'
elseif mode == 'DanNet' then
if not mq.TLO.Plugin('mq2dannet').IsLoaded() then
print('DanNet Not Loaded... Loading DanNet...')
mq.cmd('/plugin dannet')
end
groupCmd = '/dgae '
end
mq.imgui.init('Adventure Status', GUI_AdvStatus)
end

Expand All @@ -84,7 +102,13 @@ local function loop()
guiOpen = true
if not AdvWIN.Open() and eqWinOpen then eqWinOpen = false end -- if we opened through GUI and closed in game reset flag.
-- if ingame window is open and we didn't set the flag close it on all characters. we most likely zoned or just accepted the quest.
if not eqWinOpen and AdvWIN.Open() then mq.cmdf('/noparse %s/lua parse mq.TLO.Window("AdventureRequestWnd").DoClose()',groupCmd) end
if not eqWinOpen and AdvWIN.Open() then
if mode == 'Solo' then
AdvWIN.DoClose()
else
mq.cmdf('/noparse %s/lua parse mq.TLO.Window("AdventureRequestWnd").DoClose()',groupCmd)
end
end
else
guiOpen = false
end
Expand Down

0 comments on commit ee7a0f7

Please sign in to comment.