Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("right")
- function Minuteur()
- s = 0
- m = 0
- h = 0
- f = 0
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.green)
- mon.clear()
- rs.setOutput("back",false)
- while f == 0 do
- mon.setCursorPos(3,1)
- mon.write("-")
- mon.setCursorPos(9,1)
- mon.write("-")
- mon.setCursorPos(15,1)
- mon.write("-")
- mon.setCursorPos(3,2)
- mon.write(h)
- mon.setCursorPos(9,2)
- mon.write(m)
- mon.setCursorPos(15,2)
- mon.write(s)
- mon.setCursorPos(3,3)
- mon.write("+")
- mon.setCursorPos(9,3)
- mon.write("+")
- mon.setCursorPos(15,3)
- mon.write("+")
- if h < 10 then
- mon.setCursorPos(4,2)
- mon.write(" h ")
- elseif h > 9 then
- mon.setCursorPos(5,2)
- mon.write(" h")
- end
- if m < 10 then
- mon.setCursorPos(10,2)
- mon.write(" m ")
- elseif m > 9 then
- mon.setCursorPos(11,2)
- mon.write(" m")
- end
- if s < 10 then
- mon.setCursorPos(16,2)
- mon.write(" s ")
- elseif s > 9 then
- mon.setCursorPos(17,2)
- mon.write(" s")
- end
- mon.setTextColor(colors.blue)
- mon.setCursorPos(1,5)
- mon.write("Retour")
- mon.setCursorPos(14,5)
- mon.write("Start")
- mon.setTextColor(colors.green)
- event, side, x, y = os.pullEvent("monitor_touch")
- if x == 3 and y == 1 and h > 0 then
- h = h - 1
- elseif x == 3 and y == 3 and h < 24 then
- h = h + 1
- elseif x == 9 and y == 1 and m > 0 then
- m = m - 1
- elseif x == 9 and y == 3 and m < 60 then
- m = m + 1
- elseif x == 15 and y == 1 and s > 0 then
- s = s - 1
- elseif x == 15 and y == 3 and s < 60 then
- s = s + 1
- elseif x < 6 and y == 5 then
- os.reboot()
- elseif x > 12 and y == 5 then
- f = 1
- end
- end
- while true do
- rs.setOutput("back",true)
- mon.setBackgroundColor(colors.green)
- mon.clear()
- mon.setTextColor(colors.red)
- mon.setCursorPos(1,2)
- mon.write(h)
- mon.setCursorPos(5,2)
- mon.write(":")
- mon.setCursorPos(9,2)
- mon.write(m)
- mon.setCursorPos(13,2)
- mon.write(":")
- mon.setCursorPos(17,2)
- mon.write(s)
- if h > 9 then
- mon.setCursorPos(3,2)
- mon.write(" ")
- elseif h < 10 then
- mon.setCursorPos(2,2)
- mon.write(" ")
- end
- if m > 9 then
- mon.setCursorPos(11,2)
- mon.write(" ")
- elseif m < 10 then
- mon.setCursorPos(10,2)
- mon.write(" ")
- end
- if s < 10 then
- mon.setCursorPos(18,2)
- mon.write(" ")
- end
- if s == 0 and m > 0 then
- s = 59
- m = m - 1
- elseif s > 0 then
- s = s - 1
- elseif s == 0 and m > 0 and h > 0 then
- m = m - 1
- s = 59
- elseif s == 0 and m == 0 and h > 0 then
- h = h - 1
- m = 59
- s = 59
- elseif s == 0 and m == 0 and h == 0 then
- os.reboot()
- end
- sleep(1)
- end
- end
- while true do
- mon.setBackgroundColor(colors.red)
- mon.clear()
- mon.setTextScale(1)
- mon.setCursorPos(5,1)
- mon.setTextColor(colors.black)
- mon.write("Soul Shard")
- mon.setCursorPos(9,5)
- mon.setTextColor(colors.blue)
- mon.write("Minuteur->")
- mon.setCursorPos(8,3)
- mon.setTextColor(colors.green)
- mon.write("Stop")
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 8 and y == 5 then
- Minuteur()
- else
- rs.setOutput("bottom",true)
- mon.setBackgroundColor(colors.green)
- mon.clear()
- mon.setCursorPos(5,1)
- mon.setTextColor(colors.black)
- mon.write("Soul Shard")
- mon.setTextColor(colors.blue)
- mon.setCursorPos(9,5)
- mon.write("Minuteur->")
- mon.setCursorPos(8,3)
- mon.setTextColor(colors.red)
- mon.write("Run")
- event, side, x, y = os.pullEvent("monitor_touch")
- end
- if x > 8 and y == 5 then
- Minuteur()
- else
- rs.setOutput("bottom",false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement