Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.find("monitor")
- --Alteravel
- local time = 10 --Update
- local interval = 8 --Intervalo de noites
- --Nao mexer
- local day = 0
- local music = false
- local next = os.day()
- while true do
- if day ~= os.day() then
- day = os.day()
- if day >= next then
- next = next + 1
- end
- while next%interval ~= 0 do
- next = next + 1
- end
- if day%interval == 0 then
- if music == false then
- music = true
- monitor.setBackgroundColour(colors.red)
- rs.setOutput("bottom", true)
- sleep(1)
- rs.setOutput("bottom", false)
- end
- else
- monitor.setBackgroundColour(colors.green)
- music = false
- end
- monitor.clear()
- monitor.setTextScale(1)
- monitor.setCursorPos(1,1)
- monitor.setTextColour(colors.white)
- monitor.write("Hoje:")
- monitor.setCursorPos(1,2)
- monitor.write("dia " .. string.format("%i", day))
- monitor.setCursorPos(1,4)
- monitor.setTextColour(colors.black)
- monitor.write("Negada:")
- monitor.setCursorPos(1,5)
- monitor.write("dia " .. string.format("%i", next))
- end
- sleep(time)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement