Advertisement
Dima99

Pick6

Jul 5th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. --My program for computer craft's turtles (Minecraft)
  2. --Place some torches in the first slot
  3.  
  4. function torch()
  5. turtle.back()
  6. turtle.down()
  7. if turtle.detectDown() then
  8. turtle.up()
  9. turtle.placeDown()
  10. else
  11. turtle.select(2)
  12. turtle.placeDown()
  13. turtle.up()
  14. turtle.select(1)
  15. turtle.placeDown()
  16. end
  17. turtle.forward()
  18. end
  19. h = 0
  20. a = 0
  21. print("What distance?")
  22. a = read()
  23. l = true
  24. while l do
  25. p = turtle.getItemCount(1)
  26. if p == 0 then
  27. print("Put some torchs in the first slot")
  28. sleep(1)
  29. term.clear()
  30. term.setCursorPos(1, 1)
  31. sleep(1)
  32. else
  33. l = false
  34. end
  35. end
  36. for i = 0, a do
  37. turtle.dig()
  38. turtle.digUp()
  39. turtle.digDown()
  40. turtle.forward()
  41. h = h+1
  42. if h == 10 then
  43. torch()
  44. h = 0
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement