Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local robot = require("robot")
- --selectItem
- function selectItem(name)
- local item
- for slot = 1, 16 do
- print(slot)
- item = component.inventory_controller.getStackInInternalSlot(slot)
- if item ~= nil then
- print(item["name"])
- end
- if item ~= nil and item.name == name then
- print("found item")
- robot.select(slot)
- return true
- end
- end
- print("not found")
- return false -- could not find item
- end
Advertisement
Add Comment
Please, Sign In to add comment