Hatte grade iwie lust dazu..
PHP Code:
local clockk = tonumber(os.date ("%H"))
local e_t = {
--1 = Nacht
--2 = Abends
--3 = morgens
--4 = Morgensdämmerung
[00] = {1,"moonlight04"},
[01] = {1,"moonlight04"},
[02] = {1,"moonlight04"},
[03] = {1,"moonlight04"},
[04] = {1,"moonlight04"},
[05] = {4,"morning"},
[06] = {4,"morning"},
[07] = {3,"predawn"},
[08] = {3,"predawn"},
[20] = {2,"evening_new"},
[21] = {2,"evening_new"},
[22] = {1,"moonlight04"},
[23] = {1,"moonlight04"}
}
local c = e_t[clockk] or {0,"nil"}
if pc.getqf("change") != c[1] then
--chat("SET "..file.."")
pc.setqf("change",c[1])
cmdchat("day_mode_change "..c[1].." "..c[2].."")
setskin(NOWINDOW)
end
oder für die ganz coolen
PHP Code:
local cl = tonumber(os.date ("%H"))
local pt = ((cl >22 or cl < 4) and {1,"moonlight04"}) or ((cl == 20 or cl == 21) and {2,"evening_new"}) or ((cl == 5 or cl == 6) and {4,"morning"}) or ((cl ==7 or cl == 8) and {3,"predawn"}) or {0,"nil"}
if pc.getqf("change") != pt[1] then
pc.setqf("change",pt[1])
cmdchat("day_mode_change "..pt[1].." "..pt[2].."")
setskin(NOWINDOW)
end
Alles das gleiche