Originally Posted by Dolgubon
Those constants would all be the same, dailies all reset at the same time. GetNumSexondsBeforeReset is then quite easy to code.
|
UndauntedDaily does this for years already.
A simple function could look like this:
Lua Code:
local SECONDS_PER_DAY = 24 * 3600
local QUEST_RESET_TIME_UTC = 6 * 3600
local function GetSecondsBeforeDailyQuestReset(now)
now = now or GetTimeStamp()
local secondsSinceMidnightUtc = now % SECONDS_PER_DAY
local diff = GetDiffBetweenTimeStamps(QUEST_RESET_TIME_UTC, secondsSinceMidnightUtc)
if(diff < 0) then
diff = diff + SECONDS_PER_DAY
end
return diff
end