Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oreMot = peripheral.wrap("extractor_8")
- local dustMot = peripheral.wrap("extractor_9")
- local oreSig = "left"
- local dustSig = "right"
- local endDir = "south"
- function slotTable(nr, rig)
- --print (rig.getStackInSlot(nr))
- return rig.getStackInSlot(nr)
- end
- function getResult(mode)
- if mode == 1 then
- --print("ore machine")
- machine = oreMot
- matSlot1 = 1
- matSlot2 = 4
- resSlot1 = 5
- resSlot2 = 2
- resSlot3 = 8
- resSlot4 = 9
- signal = oreSig
- opDir = "north"
- else
- --print("dust machine")
- machine = dustMot
- matSlot1 = 2
- matSlot2 = 3
- resSlot1 = 7
- resSlot2 = 4
- signal = dustSig
- opDir = "south"
- end
- --check if machines have stuff to work with, if not take away Red
- if slotTable(matSlot1, machine) == nil and slotTable(matSlot2, machine) == nil then
- print (tostring(matSlot1) .. "and" .. tostring (matSlot2) .. " are empty")
- rs.setOutput(signal, false)
- else
- rs.setOutput(signal, true)
- end
- --first result material (dust/solution) gets moved
- if slotTable(resSlot1, machine) ~= nil then
- machine.pushItemIntoSlot(opDir, resSlot1, 64, resSlot1 - 3)
- end
- --move more sutff
- if slotTable(resSlot2, machine) ~= nil then
- machine.pushItemIntoSlot(opDir, resSlot2, 64, resSlot2)
- end
- if machine == oreMot then
- if slotTable(resSlot3, machine) ~= nil then
- --print ("pushing")
- machine.pushItem(endDir, resSlot3, 64)
- --else
- --print("done")
- elseif slotTable(resSlot4, machine) ~= nil then
- machine.pushItem(endDir, resSlot4, 64)
- end
- end
- end
- while true do
- getResult(1)
- getResult(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement