Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- robot = require("component").robot
- sides = require("sides")
- ic = require("component").inventory_controller
- crafting = require("component").crafting
- local selectedSlot = 1
- local howMany = ...
- howMany = tonumber(howMany)
- function turnAround()
- robot.turn(true)
- robot.turn(true)
- end
- function craftItem()
- robot.select(1)
- ic.equip()
- crafting.craft(1)
- ic.equip()
- robot.select(selectedSlot)
- usesRemaining = 32
- end
- function placeItem(dir)
- local success = true
- if robot.count(selectedSlot) == 0 then
- if (selectedSlot == 16) then
- return false, "Out of Items"
- end
- selectedSlot = selectedSlot + 1
- robot.select(selectedSlot)
- end
- success = robot.place(dir)
- robot.use(dir)
- return success
- end
- for i = 0, howMany, 5 do
- placeItem(sides.up)
- robot.move(sides.forward)
- robot.move(sides.forward)
- robot.move(sides.forward)
- robot.move(sides.forward)
- robot.move(sides.forward)
- robot.move(sides.forward)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement