funkd0ct0r

Untitled

Dec 25th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- G4NA2iFC
  2.  
  3.  
  4. local sizeX
  5. local sizeZ
  6. local curX = 0
  7. local curZ = 0
  8. local slot = 1
  9.  
  10. sizeX, sizeZ = ...
  11. sizeX = tonumber(sizeX)
  12. sizeZ = tonumber(sizeZ)
  13. turtle.select(slot)
  14.  
  15.  
  16. while true do
  17.  
  18. while turtle.getItemCount(slot) == 0 do
  19. slot = slot % 16 + 1
  20. turtle.select(slot)
  21. sleep(0)
  22. end
  23. turtle.placeDown()
  24.  
  25. if curX % 2 == 0 then
  26. if curZ == sizeZ - 1 then
  27. if curX == sizeX - 1 then
  28. return
  29. else
  30. turtle.turnRight()
  31. while not turtle.forward() do sleep(0) end
  32. turtle.turnRight()
  33. curX = curX + 1
  34. end
  35. else
  36. curZ = curZ + 1
  37. while not turtle.forward() do sleep(0) end
  38. end
  39. else -- curX % 2 ~= 0
  40.  
  41. if curZ == 0 then
  42. if curX == sizeX - 1 then
  43. return
  44. else
  45. turtle.turnLeft()
  46. while not turtle.forward() do sleep(0) end
  47. turtle.turnLeft()
  48. curX = curX + 1
  49. end
  50. else
  51. curZ = curZ - 1
  52. while not turtle.forward() do sleep(0) end
  53. end
  54.  
  55. end
  56.  
  57. end
Advertisement
Add Comment
Please, Sign In to add comment