Jump to content

Module:Sandbox/2NumForIce/!/wb sw time

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 2NumForIce (talk | contribs) at 05:32, 14 November 2023 (use p from mw manual). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- os.date &w is Sun/Mon/.../Fri/Sat, 0-5. Use UTC!
local p = {} --p stands for package

function p.wb_sw_time( frame )
if tonumber(os.date("%w")) >= 1 and tonumber(os.date("%w")) <= 5 and tonumber(os.date("%H")) >= 16 and tonumber(os.date("%H")) <= 23 then
	return "SCHOOL"
elseif frame.args[1] == "true" and tonumber(os.date("%H")) >= 6 and tonumber(os.date("%H")) <= 14 then
	return "SLEEP"
else
	return "HIDDEN"
end end return p