Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- rednet.open("top")
- if fs.exists("time") == false then
- cFile = fs.open("time","w")
- cFile.writeLine(math.floor(0))
- cFile.close()
- curTime = 0
- else
- rFile = fs.open("time","r")
- curTime = rFile.readLine()
- rFile.close()
- curTime = math.floor(curTime)
- end
- function saveTime(n)
- sFile = fs.open("time","w")
- sFile.writeLine(math.floor(n))
- sFile.close()
- end
- function sendTime(sTime)
- tempTable = {["Key"] = "Timer",["Time"] = sTime}
- print(textutils.serialize(tempTable))
- rednet.broadcast(textutils.serialize(tempTable))
- end
- while true do
- shell.run("clear")
- print("TIME: " .. curTime)
- saveTime(curTime)
- sendTime(curTime)
- curTime = curTime + 10
- sleep(10)
- end
Add Comment
Please, Sign In to add comment