This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

alert type
#6
Change eventlog function to replace day names. Keep in mind that this will only work for newly events after the function has been modified.
Code:
function eventlog(text)
  local max = 1000 -- max number of entries

  -- add formatted date
  local date = os.date('%a %d/%m/%Y %T ')

  date = date:gsub('%a+', {
    Mon = 'lun.',
    Tue = 'mar.',
    Wed = 'mer.',
    Thu = 'gio.',
    Fri = 'ven.',
    Sat = 'sab.',
    Sun = 'dom.',
  })

  storage.exec('lpush', 'eventlog', date .. text)
  storage.exec('ltrim', 'eventlog', 0, max - 1)
end
Reply


Messages In This Thread
alert type - by Frank68 - 21.10.2020, 13:57
RE: alert type - by admin - 23.10.2020, 12:38
RE: alert type - by Frank68 - 23.10.2020, 14:30
RE: alert type - by admin - 23.10.2020, 14:49
RE: alert type - by Frank68 - 26.10.2020, 09:30
RE: alert type - by admin - 27.10.2020, 08:32

Forum Jump: