Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x = 3 -- position text X
- local y = 1 -- position text Y
- local tArgs = {...} -- timer
- local t = tArgs[1]
- local monitor = peripheral.wrap("back")
- local speaker = peripheral.wrap("top")
- while true do
- os.pullEvent("redstone")
- if rs.getInput("bottom") then
- -- start timer
- for i = t,0,-1 do
- monitor.clear()
- monitor.setCursorPos(x,y)
- monitor.setTextScale(4)
- if i < t/5 then
- monitor.setTextColor(colors.red)
- speaker.speak(tostring(i),10,"fr")
- elseif i < t/5*2 then
- monitor.setTextColor(colors.orange)
- elseif i < t/5*3 then
- monitor.setTextColor(colors.yellow)
- elseif i < t/5*4 then
- monitor.setTextColor(colors.green)
- else
- monitor.setTextColor(colors.blue)
- end
- monitor.write(tostring(i))
- sleep(1)
- end
- -- end of timer
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement