Advertisement
SenpaiJody

OpenComputers Smelter/Tank

Mar 28th, 2023 (edited)
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3.  
  4.  
  5. local smelterTank = {}
  6.  
  7. local smelter = component.proxy("f1f14ed9-af40-47ac-a9f6-1334a5d2986c")
  8. local smelterInputSide = sides.north
  9. local smelterOutputSide = sides.south
  10.  
  11. local tank = component.proxy("8f1fee0c-0eff-44aa-954d-7448a9623a99")
  12. local tankInputSide = sides.south
  13. local tankOutputSide = sides.north
  14.  
  15. function smelterTank.transferToTank(amount)
  16.     amount = amount or 1296
  17.     smelter.transferFluid(smelterInputSide, smelterOutputSide, amount)
  18.     end
  19. function smelterTank.transferToSmelter(amount)
  20.     amount = amount or 1296
  21.     tank.transferFluid(tankInputSide, tankOutputSide, amount)
  22.     end
  23.  
  24. if arg[1] == "toTank" then
  25.     transferToTank(tonumber(arg[2]))
  26. elseif
  27.     arg[1] == "toSmelter" then
  28.     transferToSmelter(tonumber(arg[2]))
  29.     end
  30.  
  31. return smelterTank
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement