abuklao84

Untitled

Apr 28th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. t_direction = "right"
  2.  
  3. function dig(amount)
  4. for i=1,amount do
  5. if turtle.detect() then
  6. turtle.dig()
  7. end
  8. turtle.forward()
  9. end
  10. end
  11.  
  12. function dispose()
  13. turtle.select(1)
  14. for y = 1,16 do
  15. turtle.select(y)
  16. turtle.dropUp()
  17. end
  18. end
  19. function checkFuel()
  20. if turtle.getFuelLevel() < 400 then
  21. turtle.select(1)
  22. turtle.suckDown()
  23. turtle.refuel()
  24. end
  25. end
  26. function turnAround(row)
  27. if row ~= 6 then
  28. if t_direction == "right" then
  29. turtle.turnRight()
  30. turtle.dig()
  31. turtle.forward()
  32. turtle.turnRight()
  33. t_direction = "left"
  34. else
  35. turtle.turnLeft()
  36. turtle.dig()
  37. turtle.forward()
  38. turtle.turnLeft()
  39. t_direction = "right"
  40. end
  41. end
  42. end
  43. while true do
  44. sleep(5)
  45. checkFuel()
  46. for r=1,6 do
  47. if r==2 or r==3 then
  48. dig(3)
  49. else
  50. dig(4)
  51. end
  52. turnAround(r)
  53. end
  54. turtle.dig()
  55. turtle.forward()
  56. turtle.turnRight()
  57. for d =1,5 do
  58. turtle.dig()
  59. turtle.forward()
  60. end
  61. turtle.turnRight()
  62. turtle.dig()
  63. turtle.forward()
  64. dispose()
  65. t_direction = "right"
  66. sleep(20)
  67. end
Advertisement
Add Comment
Please, Sign In to add comment