Advertisement
iWasHere

enderfence

Jun 18th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. args = {...}
  2. moves=0
  3. sides=0
  4. slot=1
  5. moved=0
  6.  
  7. function fencePlace()
  8. repeat
  9. turtle.placeDown()
  10. turtle.forward()
  11. moved = moved + 1
  12. moves = moves + 1
  13. until moves = arg[1]
  14. turtle.turnRight()
  15. end
  16.  
  17. function moveSlot()
  18. if turtle.getItemCount(slot) == 0 then
  19. if slot == 5 then
  20. slot = 1
  21. turtle.select(slot)
  22. else
  23. slot = slot + 1
  24. turtle.select(slot)
  25. end
  26. end
  27. end
  28.  
  29. function gimmeFences()
  30. term.clear()
  31. term.write("I need fences!")
  32. end
  33.  
  34.  
  35. if #args == 1 then
  36. local neededFuel = args[1]*4
  37. turtle.select(16)
  38. repeat
  39. turtle.refuel(1)
  40. term.clear()
  41. term.write("Need more fuel!")
  42. until turtlegetFuelLevel() >= neededFuel
  43.  
  44. turtle.up()
  45. turtle.select(1)
  46. repeat
  47. term.write("Fences left to place: "..neededFuel-travelled)
  48. sides = sides + 1
  49. fencePlace()
  50. until sides=4
  51.  
  52. term.write("Job Done!")
  53.  
  54. else
  55. term.write("Places fences, used for an Ender Quarry.")
  56. term.write("Usage: EnderFence (sideLength)")
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement