h = 0
m = 30
s = 0
side = "back"
endmsg = "Time Is Up!"
someline = "Wrenched!"
timerend = false
local t = peripheral.wrap(side)
 
function check()
 
if s <= 0 then
  m = m -1
  s = 60
end
 
if m < 0 then
  h = h-1
  m = 60
end
 
if h < 0 then
  t.setTextScale(5)
  t.clear()
  t.setCursorPos(3,3)
  t.write(endmsg)
  redstone.setOutput("top", true)
  sleep(1)
  redstone.setOutput("top", false)
  sleep(60)
  timerend = true
 end
end
rs.setOutput("top", true)
sleep(1)
rs.setOutput("top", false)
while true do
t.clear()
t.setBackgroundColor(colors.yellow)
t.setTextScale(5)
t.setCursorPos(4,2)
t.write(someline)
--t.setTextScale(5)
t.setCursorPos(2,3)
t.write(h..":"..m..":"..s.." Left")
sleep(1)
s = s-1
check()
if timerend == true then
os.reboot()
end
end
