Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- transposer = peripheral.wrap("back")
- fluidInterface = peripheral.wrap("top")
- monitor = peripheral.wrap("right")
- if monitor ~= nil then
- monitor.setTextScale(0.5)
- end
- itemToFluidMap = {
- ["Redstone Energy Fluxduct (Empty)"] = {
- ["targetFluid"] = "redstone",
- ["millibucketsNeeded"] = 200
- },
- ["Cryo-Stabilized Fluxduct (Empty)"] = {
- ["targetFluid"] = "cryotheum",
- ["millibucketsNeeded"] = 500
- }
- }
- iteration = 0
- function printDivider()
- local width, height = term.getSize()
- print(string.rep("-", width))
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Iteration: " .. iteration)
- local currentTransposerItem = transposer.getItem(1)
- if currentTransposerItem ~= nil then
- -- print("Item found in Liquid Transposer!")
- local currentTransposerItemName = currentTransposerItem.getMetadata().displayName
- print(currentTransposerItemName .. " found!")
- printDivider()
- local targetFluidData = itemToFluidMap[currentTransposerItemName]
- -- print(targetFluidData)
- if targetFluidData ~= nil then
- local targetFluid = targetFluidData["targetFluid"]
- local targetFluidTankIndex = nil
- for tankIndex, fluidData in pairs(fluidInterface.getTanks()) do
- if targetFluid == fluidData.name then
- targetFluidTankIndex = tankIndex
- print("Found targetFluid: " .. targetFluid .. " in tank " .. targetFluidTankIndex)
- printDivider()
- --print(textutils.serialise(fluidData))
- end
- end
- if targetFluidTankIndex ~= nil then
- transposer.pullFluid(peripheral.getName(fluidInterface), targetFluidData.millibucketsNeeded, targetFluid)
- else
- print("Target Fluid " .. targetFluid .. " not found!")
- printDivider()
- end
- else
- print("Target Fluid not set!")
- printDivider()
- end
- sleep(2)
- else
- print("No item found in Fluid Transposer. Waiting...")
- sleep(60)
- end
- iteration = iteration + 1
- --print(targetFluid)
- end
- textutils.pagedPrint("Any key to continue")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement