Reedalini

Computercraft Timer!

Apr 28th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. print("How long do you want the timer to be?")
  2. time = tonumber(read())
  3. if time <= 0 then
  4.  print("Error, Time cannot be 0")
  5.  os.sleep(5)
  6.  shell.run('clear')
  7. else
  8.  print("Starting timer")
  9.  os.sleep(2)
  10.  repeat
  11.   shell.run('clear')
  12.   print("                                       ")
  13.   print("                                       ")
  14.   print("                                       ")
  15.   print("=======================================")  
  16.   print("---------------------------------------")
  17.   print("                  "..time.."             ")
  18.   print("---------------------------------------")
  19.   print("    Press Ctrl+T to stop the timer")
  20.   print("---------------------------------------")
  21.   print("=======================================")
  22.   os.sleep(1)
  23.   time = time - 1
  24.  until time == 0
  25.  i = 0
  26.  repeat
  27.   print("Timer Done!")
  28.   os.sleep(0.3)
  29.   shell.run('clear')
  30.   os.sleep(0.3)
  31.   i = i + 1
  32.  until i == 5
  33. end
Advertisement
Add Comment
Please, Sign In to add comment