Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require 'robot'
- local move = require 'move'
- local mine = require 'mine'
- local component = require 'component'
- local sides = require 'sides'
- local sugarcane = {}
- --
- print("Initializing...")
- function sugarcane.deposit()
- count = 19
- repeat
- component.inventory_controller.dropIntoSlot(3, count, 64)
- count = count + 1
- until count > 27
- count = 19
- end
- function sugarcane.rowHarvest(x)
- x = 1
- for i = 1, x do
- move.forward(8)
- end
- end
- function sugarcane.topHarvest(x)
- x = 1
- for i = 1, x do
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.left(1)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.left(1)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- end
- end
- function sugarcane.midHarvest(x)
- x = 1
- for i = 1, x do
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.left(1)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.left(1)
- sugarcane.rowHarvest()
- robot.turnAround()
- move.right(2)
- sugarcane.rowHarvest()
- end
- end
- function sugarcane.Field1(x)
- x = 1
- while x == 1 do
- print("Moving to position.")
- move.up()
- move.forward()
- move.right(3)
- move.forward()
- print("In position, begin harvest.")
- sugarcane.topHarvest()
- robot.turnAround()
- move.right(8)
- move.down()
- sugarcane.midHarvest()
- print("Harvest complete, moving to deposit inventory and recharge")
- move.up()
- move.forward(2)
- move.left(5)
- robot.turnAround()
- move.down()
- print("Depositing inventory.")
- -- component.inventory_controller.dropIntoSlot(3, 25, 64)
- -- component.inventory_controller.dropIntoSlot(3, 26, 64)
- -- component.inventory_controller.dropIntoSlot(3, 27, 64)
- sugarcane.deposit()
- print("Recharging.")
- os.sleep(30)
- print("Charge complete")
- end
- end
- return sugarcane
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement