Niseg

single turtle well placer inspired by psyestorm(old version)

Jun 7th, 2013
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. local miningwell=1
  2. local chest=2
  3. local conduit=3
  4. local args={...}
  5. local slp = 10
  6. local lx=30
  7. local ly=30
  8. local slot=3
  9. if args[1] ~= nil then slp = tonumber(args[1]) end
  10. if args[2] ~= nil then lx = tonumber(args[2]) end
  11. if args[3] ~= nil then ly = tonumber(args[3]) end
  12.  
  13. for j=1,ly do
  14. slot=0
  15. for i=1,lx do
  16.  
  17. while slot < 13 and turtle.getItemCount(conduit+slot)== 0 do slot=slot+1 end
  18. if slot==13 then break end
  19.  
  20. turtle.select(miningwell)
  21. turtle.placeDown()
  22. turtle.back()
  23. turtle.select(chest)
  24. turtle.placeDown()
  25.  
  26. turtle.select(conduit+slot)
  27.  
  28. turtle.place()
  29. sleep(slp) --don't remember how long
  30. turtle.select(chest)
  31. turtle.digDown()
  32. turtle.down()
  33. turtle.select(miningwell)
  34. if turtle.getItemCount(miningwell)>0 then
  35.     slp=slp+1
  36.     turtle.drop()
  37. end
  38. turtle.dig()
  39. turtle.up()
  40.  
  41. end
  42. turtle.select(conduit)
  43. --- retract the conduits
  44. while turtle.detect() do  turtle.dig(); turtle.forward(); end;
  45.  
  46. turtle.turnLeft()
  47. turtle.back()
  48. turtle.placeDown()
  49. turtle.turnRight()
  50. turtle.back()
  51. turtle.place()
  52. turtle.back()
  53. turtle.place()
  54. end
Advertisement
Add Comment
Please, Sign In to add comment