Advertisement
FellHead

Oreberry farm chunk OC

Apr 9th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local robot = require("robot")
  2. local comp = require("computer")
  3.  
  4. function harvest()
  5. robot.forward()
  6.   for y=1, 15 do
  7.     -- harvest one line
  8.     robot.useDown()
  9.     robot.useUp()
  10.     robot.suck()
  11.     robot.suck()
  12.     for x=1, 15 do
  13.       robot.forward()
  14.       robot.useDown()
  15.       robot.useUp()
  16.       robot.suck()
  17.       robot.suck()
  18.     end
  19.         -- povorot
  20.         --esli y nechetnoe to
  21.     if y%2 == 1 then
  22.           robot.turnLeft()
  23.           robot.forward()
  24.           robot.turnLeft()
  25.         else
  26.           robot.turnRight()
  27.           robot.forward()
  28.           robot.turnRight()
  29.         end
  30.   end
  31.   -- na posledneij linii
  32.       robot.useDown()
  33.       robot.useUp()
  34.       robot.suck()
  35.       robot.suck()
  36. for x=1, 15 do
  37.       robot.forward()
  38.       robot.useDown()
  39.       robot.useUp()
  40.       robot.suck()
  41.       robot.suck()
  42.     end
  43.   -- vozvrat
  44.        robot.turnLeft()
  45.            while robot.detect()==false do
  46.            robot.forward()
  47.            end
  48.        robot.turnLeft()
  49.        end
  50. end
  51.  
  52. function unload()
  53.   for c = 1, 32 do
  54.     robot.select(c)
  55.     robot.dropDown()
  56.     end
  57.   end
  58. end
  59.  
  60. while true do
  61.   harvest()
  62.   unload()
  63.   print('sleep')
  64.   os.sleep(1800)
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement