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)
- robot.select(slot)
- N = robot.count(slot)
- if not robot.compareTo(16) and N>0 then
- inv.equip()
- for i = 1, N do
- robot.useDown()
- end
- end
- end
- local function dropcompare(slot)
- robot.select(slot)
- if robot.compareTo(16) then
- robot.dropDown(1)
- end
- end
- local function activatealtar()
- for i = 2, 15 do --dropping living rock
- dropcompare(i)
- end
- robot.down()
- robot.select(1)
- robot.placeDown()
- end
- while true do
- if robot.count(2) and robot.count(3) > 0 and red.getComparatorInput(sides.down) == 0 then
- os.sleep(0.1)
- for i = 2, 15 do --use all items except living rock
- dropcomparenot(i)
- end
- while true do
- if red.getComparatorInput(sides.down) == 2 then
- break
- end
- os.sleep(0.2)
- end
- robot.up()
- activatealtar()
- os.sleep(0.1)
- for i = 2, 15 do
- robot.select(i)
- robot.drop()
- end
- pulse(pulsetime)
- end
- os.sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment