Advertisement
absorr

ccCountdown

Sep 8th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. while not rs.getInput("bottom") do
  2.    
  3. end
  4.  
  5. local start = 20
  6. term.setBackgroundColor(colors.white)
  7. term.setTextColor(colors.cyan)
  8.  
  9. local i = start;
  10. while i > 0
  11.     if i >= 10 then
  12.         term.clear()
  13.         term.setCursorPos(1,1)
  14.         if i == 10 then term.setTextColor(colors.red) end
  15.         print i
  16.         sleep(1)
  17.     elseif i > 5 then
  18.         term.clear()
  19.         term.setCursorPos(1,1)
  20.         term.setTextColor(colors.red)
  21.         print "0" .. i
  22.         sleep(1)
  23.     else
  24.         term.setBackgroundColor(colors.red)
  25.         term.clear()
  26.         term.setCursorPos(1,1)
  27.         term.setTextColor(colors.white)
  28.         print "0" .. i
  29.         sleep(0.5)
  30.         term.setBackgroundColor(colors.white)
  31.         term.clear()
  32.         term.setCursorPos(1,1)
  33.         term.setTextColor(colors.red)
  34.         print "0" .. i
  35.         sleep(0.5)
  36.     end
  37. end
  38.  
  39. term.clear()
  40. term.setCursorPos(1,1)
  41. print "00"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement