Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Server
- --Settings
- local bkgColour = colors.cyan --Timer text colour
- local txtColour = colors.yellow --Timer background colour
- local duration = 30 --Time in minutes
- --
- local scId = 13
- local fSec
- local fMin
- local fTime
- --Client Init
- rednet.open('back')
- rednet.send(scId,"update")
- rednet.send(scId,bkgColour)
- rednet.send(scId,txtColour)
- --rednet.send(scId,
- function timeFormat(int)
- if (int == 0) or (int == 60) then
- return "00"
- elseif int < 10 then
- return "0"..tostring(int)
- else
- return tostring(int)
- end
- end
- rednet.send(scId,tostring(duration)..":00")
- cmd = read()
- if cmd == "run" then
- for min = 0,duration do
- min = min + 1
- fmin = duration - min
- for sec = 0,59 do
- sleep(1)
- sec = sec + 1
- fsec = 60 - sec
- fTime = timeFormat((fmin))..":"..timeFormat((fsec))
- rednet.send(scId,fTime)
- --sleep(1)
- --sec = sec + 1
- end
- --min = min +1
- end
- elseif cmd == "bkg" then
- Print("enter new background colour:")
- newC = read()
- bkgColor = "colors."..newC
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement