Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comp = require("component")
- sides = require("sides")
- robot = require("robot")
- count = 0
- columns = 5
- rows = 0
- function clear()
- robot.use()
- require("os").sleep(2)
- robot.use()
- end
- function scanChest()
- local inv = comp.inventory_controller.getStackInSlot(sides.front, 1)
- if(inv == nil) then
- return true
- else
- return false
- end
- end
- function fill()
- robot.turnAround()
- comp.inventory_controller.suckFromSlot(sides.front, 1, 1)
- robot.turnAround()
- comp.inventory_controller.dropIntoSlot(sides.front, 1, 1)
- end
- function scanFill()
- if scanChest() then
- fill()
- end
- end
- function colFill()
- for i=1, 3 do
- scanFill()
- robot.up()
- end
- end
- function nextCol()
- robot.down()
- robot.down()
- robot.down()
- robot.turnLeft()
- robot.forward()
- robot.turnRight()
- end
- function reset(count)
- robot.turnRight()
- for i=1, count do
- robot.forward()
- end
- end
- function main()
- clear()
- robot.turnLeft()
- for i=1, columns do
- colFill()
- nextCol()
- count = count + 1
- end
- reset(count)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement