Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ender = peripheral.find("enderstorage:ender_chest")
- local enderName = peripheral.getName(ender)
- local controllers = table.pack({peripheral.find("storagedrawers:controller")})
- local mek = peripheral.wrap("ironchest:obsidian_chest_2")
- local mekName = peripheral.getName(mek)
- local imm = peripheral.wrap("ironchest:obsidian_chest_0")
- local immName = peripheral.getName(imm)
- local foregoing = peripheral.wrap("ironchest:obsidian_chest_6")
- local foregoingName = peripheral.getName(foregoing)
- local organics = peripheral.wrap("ironchest:obsidian_chest_3")
- local organicsName = peripheral.getName(organics)
- local organicNames = {"petal", "dye", "flower", "mushroom", "head", "tear", "shell", "kelp", "wing"}
- local woodItems = peripheral.wrap("ironchest:obsidian_chest_5")
- local woodItemsName = peripheral.getName(woodItems)
- local potions = peripheral.wrap("ironchest:iron_chest_0")
- local potionsName = peripheral.getName(potions)
- local forbiddenArtifacts = peripheral.wrap("ironchest:obsidian_chest_4")
- local forbiddenArtifactsName = peripheral.getName(forbiddenArtifacts)
- local woodItemNames = {
- "scaffold", "minecraft:chest", "sign", "fence_gate", "crafting_table",
- "storagedrawers", "bowl"
- }
- local itemStored = false
- function moveItems()
- for i = 1, ender.size() do
- item = ender.getItemDetail(i)
- itemStored = false
- if (item) then
- for key, drawer in pairs(controllers[1]) do
- if not itemStored
- and ender.pushItems(peripheral.getName(drawer), i) == item.count then
- itemStored = true
- end
- end
- if not itemStored then
- if item.name:find("mekanism") then
- if ender.pushItems(mekName, i) == item.count
- then itemStored = true end
- elseif item.name:find("immersive") then
- if ender.pushItems(immName, i) == item.count
- then itemStored = true end
- elseif item.name:find("foregoing")
- or item.name:find("computercraft")
- or item.name:find("enderstorage")
- or item.name:find("fluxnetworks")
- then
- if ender.pushItems(foregoingName, i) == item.count
- then itemStored = true end
- elseif item.name:find("potion") then
- if ender.pushItems(potionsName, i) == item.count
- then itemStored = true end
- elseif item.name:find("forbidden")
- or item.name:find("artifacts")
- then
- if ender.pushItems(forbiddenArtifactsName, i) == item.count
- then itemStored = true end
- else
- for j = 1, #woodItemNames do
- if item.name:find(woodItemNames[j]) then
- if ender.pushItems(woodItemsName, i) == item.count
- then
- j = #woodItemNames
- itemStored = true
- end
- end
- end
- if not itemStored then
- for j = 1, #organicNames do
- if item.name:find(organicNames[j]) then
- if ender.pushItems(organicsName, i) == item.count
- then
- j = #organicNames
- itemStored = true
- end
- end
- end
- end
- end
- if not itemStored then
- ender.pushItems("ironchest:diamond_chest_1", i)
- end
- end
- end
- end
- end
- while true do
- moveItems()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement