Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rsBridge = peripheral.wrap("bottom")
- local reactor = peripheral.wrap("back")
- local dualStorage = peripheral.wrap("right")
- local singleStorage = peripheral.wrap("top")
- local function isReactorReady(reactor)
- return reactor.getItemDetail(1) == nil and reactor.getItemDetail(2) == nil
- end
- local function hasSingleRecipe(singleStorage)
- local details = singleStorage.getItemDetail(1)
- if details == nil then
- return false
- else
- return details.count > 1
- end
- end
- local function hasDualRecipe(dualStorage)
- return dualStorage.getItemDetail(1) ~= nil and dualStorage.getItemDetail(2) ~= nil
- end
- while true do
- while not isReactorReady(reactor) do
- sleep(1)
- end
- if hasSingleRecipe(singleStorage) then
- while hasSingleRecipe(singleStorage) do
- singleStorage.pushItems("back", 1, 1, 1)
- singleStorage.pushItems("back", 1, 1, 2)
- end
- elseif hasDualRecipe(dualStorage) then
- while hasDualRecipe(dualStorage) do
- dualStorage.pushItems("back", 1, 1, 1)
- dualStorage.pushItems("back", 2, 1, 2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement