Advertisement
jschuldes

pearls

Dec 9th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. -- harvest ender pearls
  2.  
  3. -- pastebin -f get V9rtGYcM pearls
  4.  
  5. local robot=require("robot")
  6. local computer=require("computer")
  7.  
  8. local function harvest()
  9.   robot.swingDown()
  10.   robot.select(1)
  11.   robot.placeDown()
  12.   robot.forward()
  13. end
  14.  
  15. local function row()
  16.   for i = 1, 16 do
  17.     harvest()
  18.   end
  19. end
  20.  
  21. -- assume robot is place on ground level and needs to go up one
  22. -- and move over first enderlily
  23. robot.up()
  24. robot.forward()
  25.  
  26. -- do first row
  27. row()
  28.  
  29. -- position for 2nd row
  30. robot.turnLeft()
  31. robot.forward()
  32. robot.turnLeft()
  33. robot.forward()
  34.  
  35. -- harvest 2nd row
  36. row()
  37.  
  38. -- position for 3rd row
  39. robot.turnRight()
  40. robot.forward()
  41. robot.forward()
  42. robot.turnRight()
  43. robot.forward()
  44.  
  45. -- harvest 3rd row
  46. row()
  47.  
  48. -- position for 4th row
  49. robot.turnLeft()
  50. robot.forward()
  51. robot.turnLeft()
  52. robot.forward()
  53.  
  54. -- harvest 4th row
  55. row()
  56.  
  57. -- need to add a deposit routine
  58.  
  59. -- rtb
  60. robot.down()
  61. robot.turnLeft()
  62. robot.forward()
  63. robot.forward()
  64. robot.forward()
  65. robot.forward()
  66. -- robot. turnLeft()
  67.  
  68. -- refuel & shutdown
  69. for i = 1, 10 do
  70.   robot.forward()
  71. end
  72. os.sleep(5)
  73. robot.turnLeft()
  74. robot.turnLeft()
  75. for v = 1, 10 do
  76.   robot.forward()
  77. end
  78. robot.turnRight()
  79. computer.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement