Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hours={
- split=function(t,s)
- local a={}
- for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
- table.insert(a,i)
- end
- return a
- end,
- p=function(str)
- local a = {nil,false}
- local b= {{"00","19"},{"01","20"},{"02","21"},{"03","22"},{"04","23"},{"05","00"},{"06","01"},{"07","02"},{"08","03"},{"09","04"},{"10","05"}}
- for _,c in pairs(b) do
- if str == c[1] then
- a[1]=c[2]
- a[2]=true
- end
- end
- return a
- end,
- get=function()
- local date=os.date("%X")
- local a = {}
- a=hours.split(date,":")
- if not hours.p(a[1])[2] then
- local n = tonumber(a[1])-5
- if n < 10 then
- n="0"..tostring(n)
- end
- a[1]=tostring(n)
- else
- a[1]=hours.p(a[1])[1]
- end
- return a[1]..":"..a[2]..":"..a[3]
- end
- }
- function eventLoop()
- ui.setMapName(hours.get())
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement