Compare with Previous | Blame | View Log
local timelastrun = 0
local function strsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t, i = {}, 1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
local module, text = ZAM_Stats:CreateModule("Clock")
CALLBACK_MANAGER:RegisterCallback("ZAM_Stats_Modules_Ready", function()
local curTime, amPM
local clockData
local ZO_FormatClockTime = ZO_FormatClockTime
local gmatch = string.gmatch
local tinsert = table.insert
text:SetHandler("OnUpdate", function(self, timerun)
if (timerun - timelastrun) >= 1 then
timelastrun = timerun
clockData = strsplit(ZO_FormatClockTime(), " ")
curTime, amPM = clockData[1], clockData[2] or ""
ZAM_Stats:SetModuleText(text, curTime, " "..amPM)
end
end)
end)