AKopyl

eemanager

Dec 2nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. MAX_TIME = 120
  2.  
  3. while true do
  4. term.setCursorPos(1, 1)
  5. term.clear()
  6.  
  7. print('Set timer in seconds:')
  8. input = tonumber(read())
  9. if input > MAX_TIME then
  10. input = MAX_TIME
  11. print(MAX_TIME .. ' is the max amount!')
  12. end
  13.  
  14. timer = 0
  15.  
  16. while timer < input do
  17. redstone.setOutput('back', true)
  18. sleep(0.5)
  19. timer = timer + 0.5
  20.  
  21. x, y = term.getCursorPos()
  22.  
  23. term.setCursorPos(1, y)
  24. term.write('[')
  25.  
  26. for n = 2, timer*50/input-2 do
  27. term.setCursorPos(n, y)
  28. term.write('|')
  29. end
  30.  
  31. term.setCursorPos(50, y)
  32. term.write(']')
  33. end
  34.  
  35. redstone.setOutput('back', false)
  36. end
Add Comment
Please, Sign In to add comment