Request: 2 more mq.doevents()
motivation: when running overseer.
Lua the account feels often like complete in freeze.
I started to read the
Lua in order to find out, where an addditional doevent() may be helpful.
The first point I identified was right before the delay() within the main loop.
As this delay will "freeze" the code a doevent() right before should not change a lot (if any) of the runtime of overseer itself but gives the ability tho check for any events created by the user-UI before going into the delay.
The result was, I could walk the char around or reply to questions of guildies, while overseer was doing its magic.
function main
Code:
function actions.Main()
if (Settings.General.runFullCycleOnStartup and actions.TutorialIsRequired == false) then nextAction = 'FullCycle'
else nextAction = 'Initialize'
end
while true do
ValidateCharacter()
if (nextAction ~= nil) then
if (nextAction == 'FullCycle') then SetCurrentProcess('Running complete cycle') RunCompleteCycle()
elseif (nextAction == 'Initialize') then SetCurrentProcess('Initialze') ReadInitialData()
elseif (nextAction == 'CountAgents') then SetCurrentProcess('Collecting Statistics') CollectAgentStatistics()
elseif (nextAction == 'ClaimCompletedMissions') then SetCurrentProcess('Claiming completed missions') ClaimCompletedMissions()
elseif (nextAction == 'RunTutorial') then SetCurrentProcess('Running tutorial') RunTutorial()
elseif (nextAction == 'RunConversions') then SetCurrentProcess('Running conversion quests') RunConversions()
elseif (nextAction == 'RunRecoveryQuests') then SetCurrentProcess('Running recovery quests') RunRecoveryQuests()
elseif (nextAction == 'RunRecruitQuests') then SetCurrentProcess('Running recruit quests') RunRecruitQuests()
elseif (nextAction == 'RunGeneralQuests') then SetCurrentProcess('Running general quests') RunGeneralQuests()
elseif (nextAction == 'SelectBestAgents') then SetCurrentProcess('Selecting best agents') SelectBestAgents()
elseif (nextAction == 'PreviewGeneralQuestList') then SetCurrentProcess('Generating quest preview list') PreviewGeneralQuestList()
elseif (nextAction == 'CollectAllRewards') then SetCurrentProcess('Collecting Rewards') CollectAllRewards()
elseif (nextAction == 'RetireEliteAgent') then SetCurrentProcess('Retiring Elite Agent') RetireEliteAgent(nextActionParameter)
elseif (nextAction == 'DumpQuestDetails') then SetCurrentProcess('Outputting Quest Details') DumpQuestDetails()
end
if (hasInitializedQuestTimes == false) then
SetCurrentProcess('Initialize')
ReadInitialData()
end
if (HasInitialized == false) then
InitializeTimers()
HasInitialized = true
end
EndCurrentProcess()
nextAction = nil
end
UpdateTimers()
[B] mq.doevents()
mq.delay(1000)[/B]
end
end
Laterone I ran overseer on an account with lot of agents (above 2000), so there was a longer conversion time to be expected.
The original overseer.
Lua keeps the account almost irresponsible during the conversion timespan.
walkagents
Lua:
local function walk_agents(typeIndex, action, startAction, doneAction)
if (startAction ~= nil) then
startAction(typeIndex)
end
mq.cmdf('/notify OverseerWnd OW_OM_RarityFilter listselect %s', typeIndex+1)
mq.delay(250)
local agentNode = mq.TLO.Window('OverseerWnd/OW_OM_MinionList').FirstChild
local lastAgentName = nil
[B] ::nextAgent::
if Aborting then return end
mq.doevents()[/B]
here I added a doevents()
actually the conversion is still running with this modification. Overseer is running fine and I can control the chare, almost like overseer would run in the background, despite overseer is running for more than 2 hours consecutively now. So no negtative effect to find, but a greate improvement in the possibillity to control the char.
Reading the
Lua, I saw that at different time-consuming places there are already doevents() placed. So you are allready used to place it within this nice tool.
If you might consider to add these 2 doevents(), the allover responsiveness of the char may improve notable.