SPancerfaustyna

mainReactor

May 17th, 2022 (edited)
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. barrelCoordinate = {
  2.     [1] = {["x"] = -5296, ["z"] = 1129},
  3.     [2] = {["x"] = -5296, ["z"] = 1135},
  4.     [3] = {["x"] = -5294, ["z"] = 1129},
  5.     [4] = {["x"] = -5294, ["z"] = 1135},
  6.     [5] = {["x"] = -5292, ["z"] = 1129},
  7.     [6] = {["x"] = -5292, ["z"] = 1135},
  8.     [7] = {["x"] = -5290, ["z"] = 1129},
  9.     [8] = {["x"] = -5290, ["z"] = 1135}
  10. }
  11.  
  12. print(barrel[1]["x"])
  13.  
  14.  
  15. function PeripheralInit ()
  16.     local allNames = peripheral.getNames()
  17.     for i, name in ipairs(allNames) do
  18.         type = peripheral.getType(name)
  19.        
  20.         if type == "monitor" then
  21.             monitor = peripheral.wrap(name)
  22.            
  23.         elseif type == "fissionReactorLogicAdapter" then
  24.             fissionReactor = peripheral.wrap(name)
  25.            
  26.         elseif type == "boilerValve" then
  27.             boiler = peripheral.wrap(name)
  28.            
  29.         elseif type == "turbineValve" then
  30.             turbine = peripheral.wrap(name)
  31.            
  32.         elseif type == "inductionPort" then
  33.             energy = peripheral.wrap(name)
  34.            
  35.         elseif type == "ultimateChemicalTank" then
  36.             fuel = peripheral.wrap(name)
  37.            
  38.         elseif type == "dynamicValve" then
  39.             water = peripheral.wrap(name)
  40.            
  41.         elseif type == "blockReader" then
  42.             barrels = {}
  43.             barrel = peripheral.wrap(name)
  44.             blockData = barrel.getBlockData()
  45.             if blockData.x == barrelCoordinate[1].x && blockData.z == barrelCoo
  46.             table.insert(barrels, barrel)
  47.            
  48.         elseif type == "redstoneIntegrator" then
  49.             redIntegrators = {}
  50.             redIntegrator = peripheral.wrap(name)
  51.             table.insert(redIntegrators, redIntegrator)
  52.            
  53.         end
  54.     end
  55. end
  56.  
  57.  
  58. PeripheralInit()
Add Comment
Please, Sign In to add comment