Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local os = require("os")
- local robot = require("robot")
- local inv = component.inventory_controller
- local red = component.redstone
- local pulsetime = 0.25
- local function pulse(PT)
- red.setOutput(sides.back,15)
- os.sleep(PT)
- red.setOutput(sides.back,0)
- end
- local function dropcomparenot(slot,Target1,Target2)
- robot.select(slot)
- if not robot.compareTo(Target1) and not robot.compareTo(Target2) and robot.count(slot)>0 then
- robot.dropDown()
- end
- end
- local function dropcompare(slot, Target)
- robot.select(slot)
- if robot.compareTo(Target) then
- robot.dropDown(1)
- end
- end
- local function activate()
- for i = 1, 14 do --dropping seed
- dropcompare(i,15)
- end
- end
- while true do
- if robot.count(1) and robot.count(2) and robot.count(3) > 0 then
- os.sleep(0.1)
- for i = 1, 14 do --dropping bucket
- dropcompare(i,16)
- end
- for i = 1, 14 do --use all items except seed and water bucket
- dropcomparenot(i,14,15)
- end
- activate()
- os.sleep(0.1)
- pulse(pulsetime)
- end
- os.sleep(0.1)
- end
Add Comment
Please, Sign In to add comment