Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- output=peripheral.wrap("minecraft:barrel_0")
- if string.match(args[1],":") then
- item=args[1]
- else
- item="minecraft:"..args[1]
- end
- for invnameindex,invname in pairs(peripheral.getNames()) do
- local inv=peripheral.wrap(invname)
- local t1,t2,t3=peripheral.getType(invname)
- if (t1=="inventory" or t2=="inventory" or t3=="inventory")and not(invname==peripheral.getName(output)) then
- local items=inv.list()
- for k,v in pairs(items) do
- if v.name==item then
- inv.pushItems(peripheral.getName(output),k)
- print("i found "..v.count)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement