Advertisement
PasaP

Infinity Reloaded Fluid ordering

Sep 3rd, 2021 (edited)
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. function wrapPs(peripheralName)
  2.     periTab = {}
  3.     sideTab = {}
  4.     if peripheralName == nil then
  5.         print("Fehler")
  6.     end
  7.     local peripherals = peripheral.getNames()
  8.     local i2 = 1
  9.     for i = 1, #peripherals do
  10.         if peripheral.getType(peripherals[i]) == peripheralName then
  11.             periTab[i2] = peripheral.wrap(peripherals[i])
  12.             sideTab[i2] = peripherals[i]
  13.             i2 = i2 + 1
  14.         end
  15.     end
  16.     if periTab ~= {} then
  17.         return periTab, sideTab
  18.     else
  19.         return nil
  20.     end
  21. end
  22.  
  23.  
  24. chestIn=peripheral.wrap("right")
  25. tank=peripheral.wrap("thermalexpansion:storage_tank_1")
  26. chestOut=peripheral.wrap("top")
  27.  
  28. tanks=wrapPs("industrialforegoing:black_hole_controller_reworked_tile")
  29.  
  30. amount=82944
  31.  
  32. while true do
  33. fluid=chestIn.getItemMeta(1)
  34. sleep(2)
  35. if fluid~=nil then
  36.   for i=1,#tanks do
  37.     fluidName=fluid.printout.title
  38.     print(fluidName)
  39.     tanks[i].pushFluid("thermalexpansion:storage_tank_1", amount, fluidName)
  40.   end
  41.   chestIn.pushItems("top",1)
  42. else
  43.  
  44.   print("no item")
  45.  
  46. end
  47.  
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement