Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pastebin run tqaNepSZ
- local fs = component.proxy(computer.tmpAddress())
- local gpu = component.proxy(component.list("gpu")())
- screen, _ = component.list("screen")()
- gpu.bind(screen)
- local TIME_ZONE = 0
- local t_correction = TIME_ZONE * 3600
- function floor_to_step(what,step)
- return math.floor(what/step) * step
- end
- local function getRealTime()
- local handle = fs.open("/time", "w")
- local timestamp = fs.lastModified("/time") / 1000 + t_correction
- return os.date("%H:%M:%S %d.%m.%Y", timestamp)
- end
- local function getMinecraftTime()
- local timestamp = os.time()
- year = tostring(tonumber(os.date("%Y",timestamp))-1970)
- if string.len(year) < 3 then
- for i=1,4-string.len(year) do
- year="0"..year
- end
- end
- return os.date("%H:%M:%S %d.%m.", timestamp)..year
- end
- while true do
- realtime = getRealTime()
- gametime = getMinecraftTime()
- if string.len(realtime) > string.len(gametime) then
- max = string.len(realtime)
- else
- max = string.len(gametime)
- end
- gpu.setResolution(max,2)
- gpu.set(1,1,realtime)
- gpu.set(1,2,gametime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement