Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = require("component")
- local ct = c.transposer
- local shell = require("shell")
- local sides = require("sides")
- -- CHANGE THESE BASED ON YOUR SETUP
- local storageside = sides.down
- local chestside = sides.up
- -- END CONFIG
- local args, opts = shell.parse(...)
- if args[1] then
- local searchfor = args[1]
- local count = args[2]
- local num = args[3]
- local counted = 0
- if not tonumber(searchfor) then
- local i = 0
- for i =1, (ct.getInventorySize(storageside)) do
- local item = ct.getStackInSlot(storageside, i)
- if item then
- if string.find(item.name .. "^" .. item.label .. "^", searchfor) then
- print(i .. ": " .. item.name .. " - " .. item.label .. " (" .. item.size .. ")")
- counted = counted + 1
- slot = i
- end
- end
- end
- else
- slot = tonumber(searchfor)
- number = tonumber(count)
- numbers = tonumber(num)
- counted = 1
- end
- if counted == 1 then
- if args[2] then
- if args[3]
- local h = 0
- for h = number, 1, -1 do
- ct.transferItem(storageside, chestside, numbers, slot)
- end
- end
- end
- end
- else -- No arguments indicate send everything back
- for i = ct.getInventorySize(chestside), 1, -1 do
- ct.transferItem(chestside, storageside, 64, i)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement