Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. print("By default this CnS bot will mine a distance of 128 blocks")
  2. print("Press any button to change this value")
  3.  
  4. local x, y = term.getCursorPos()
  5. local s = 5
  6. local distance
  7.  
  8. local myTimer = os.startTimer(0)
  9.  
  10. while s >= 0 do
  11. local event, param = os.pullEvent()
  12.  
  13. if event == "timer" and param == myTimer then
  14. term.setTextColor(8)
  15. term.write(s)
  16. s = s - 1
  17. term.setCursorPos(x, y)
  18. myTimer = os.startTimer(1)
  19. elseif event == "key" then
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. term.setTextColor(1)
  23. term.write("Enter the distance you'd like this CnS bot to dig.")
  24.  
  25. while true do
  26. distance = tonumber(read())
  27. if distance then
  28. break
  29. end
  30. print("Please enter an actual number.")
  31. end
  32.  
  33. break
  34. end
  35. end
  36.  
  37. --turtle.getFuelLevel(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement