- Joined
- Jan 29, 2023
- RedCents
- 190¢
Hi All. I'm writing a script to run a quest (task) repeatedly for faction. I originally keyed off of the completion text to know when the task was done, however, this had the downside of not allowing me to know if the quest was present when I started the script. So I switched over to checking the task window like this:
The thing that I observed is that when the quest completes the list doesn't refresh unless I actually open the TaskWnd. So now my script goofily opens the task window, queries the quest status, the closes the task window. It does this once every 10 seconds. The TaskWnd is only up for a split second, but still it annoys me.
Question: Is there any reliable way to query whether the task is still present without popping up the TaskWnd? I don't really want to rely on querying the "Quest Overlay" either since I'm not certain that everyone would have that visible.
I *could* do both: Check the quest status once on script launch and then after that key off of the completion text, but I just feel like there should be one unified solution that handles both well.
Thanks.
INI:
function WeHaveTheQuest()
local count = tonumber(mq.TLO.Window("TaskWnd").Child("TASK_TaskList").Items())
--print('Found ' .. count .. ' active tasks')
for j = 1,count do
local localQuestName = mq.TLO.Window("TaskWnd").Child("TASK_TaskList").List(j,3)()
--print('Task #' .. j .. ' is "' .. localQuestName .. '"')
if (localQuestName == questName) then
return true
end
end
return false
end
The thing that I observed is that when the quest completes the list doesn't refresh unless I actually open the TaskWnd. So now my script goofily opens the task window, queries the quest status, the closes the task window. It does this once every 10 seconds. The TaskWnd is only up for a split second, but still it annoys me.
Question: Is there any reliable way to query whether the task is still present without popping up the TaskWnd? I don't really want to rely on querying the "Quest Overlay" either since I'm not certain that everyone would have that visible.
I *could* do both: Check the quest status once on script launch and then after that key off of the completion text, but I just feel like there should be one unified solution that handles both well.
Thanks.