Advertisement
Dudugz-Contistente

Untitled

Sep 23rd, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. hours={
  2. split=function(t,s)
  3. local a={}
  4. for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
  5. table.insert(a,i)
  6. end
  7. return a
  8. end,
  9.  
  10. p=function(str)
  11. local a = {nil,false}
  12. local b= {{"00","19"},{"01","20"},{"02","21"},{"03","22"},{"04","23"},{"05","00"},{"06","01"},{"07","02"},{"08","03"},{"09","04"},{"10","05"}}
  13. for _,c in pairs(b) do
  14. if str == c[1] then
  15. a[1]=c[2]
  16. a[2]=true
  17. end
  18. end
  19.  
  20. return a
  21. end,
  22.  
  23. get=function()
  24. local date=os.date("%X")
  25. local a = {}
  26.  
  27. a=hours.split(date,":")
  28. if not hours.p(a[1])[2] then
  29. local n = tonumber(a[1])-5
  30.  
  31. if n < 10 then
  32. n="0"..tostring(n)
  33. end
  34.  
  35. a[1]=tostring(n)
  36. else
  37. a[1]=hours.p(a[1])[1]
  38. end
  39. return a[1]..":"..a[2]..":"..a[3]
  40. end
  41. }
  42.  
  43. function eventLoop()
  44. ui.setMapName(hours.get())
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement