• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Time w Globalevents

Xaratex

Explosia.pl
Joined
Aug 18, 2010
Messages
43
Reaction score
3
Chciałbym aby mój skrypt wykonywał się w poniedziałek o określonej godzinie. Co mam wpisać w "time" aby tak to działało?
Mógłbym zrobić sprawdzanie dnia tygodnia w samym skrypcie ale pytam z ciekawości.
 
Do 000-const.lua dodaj:
Code:
-- WEEK DAYS
SUNDAY     = 0
MONDAY     = 1
TUESDAY  = 2
WEDNESDAY = 3
THURSDAY  = 4
FRIDAY     = 5
SATURDAY  = 6

Przykład wpisu w globalevents.xml:
Code:
<globalevent name="Automatic Restart" time="1:30:00" event="script" value="basic/automaticRestart.lua"/>

Skrypt:
Code:
function onTime()
   if tonumber(os.date("%w")) ~= MONDAY then
     return true
   end
  
    -- Kod który ma być wywołany

   return true
end
 
Back
Top