Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- editables
- local cacheExtension = 4
- local chestExtension = 5
- -- etc
- local tArg = ...
- local chest = "minecraft:chest_" .. tostring(chestExtension)
- local cache = "thermalexpansion:storage_cache_" .. tostring(cacheExtension)
- local function getCollectors()
- local collector = "projecte:collector_"
- local mks = {
- "mk1",
- "mk2",
- "mk3"
- }
- local collectors = {}
- local ps = peripheral.getNames()
- for i = 1, #ps do
- for o = 1, #mks do
- if ps[i]:find(collector .. mks[o]) then
- collectors[#collectors + 1] = ps[i]
- break
- end
- end
- end
- return collectors
- end
- local function insert()
- local cols = getCollectors()
- for i = 1, #cols do
- peripheral.call(cache, "pushItems", cols[i], 1, 64)
- end
- end
- local function pullBack()
- local cols = getCollectors()
- for i = 1, #cols do
- local sz = peripheral.call(cols[i], "size")
- for o = 1, sz do
- peripheral.call(chest, "pullItems", cols[i], o, 64)
- end
- end
- end
- if not tArg then
- print("Pushing")
- insert()
- print("Done")
- else
- print("Pulling")
- pullBack()
- print("Done")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement