THEJean_Kevin

Boiler LaVoicGrave

Feb 26th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.14 KB | None | 0 0
  1. -- pastebin get 8X1mxs5L startup
  2. local Info = {}
  3. function DisplayBoiler_solid(boiler_solid,pos)
  4.  
  5.     periboiler = peripheral.wrap(boiler_solid)
  6.        
  7.         if periboiler ~= nil then
  8.             quantite_slot_1 = "item"
  9.             nom_slot_1 = 0
  10.             quantite_slot_2 = "item"
  11.             nom_slot_2 = 0
  12.             quantite_slot_3 = "item"
  13.             nom_slot_3 = 0
  14.             quantite_slot_4 = "item"
  15.             nom_slot_4 = 0
  16.  
  17.  
  18.  
  19.             --Item Boiler
  20.             if periboiler.getStackInSlot(3) ~= nil then
  21.                     quantite_slot_1 = periboiler.getStackInSlot(3).qty
  22.                     nom_slot_1 = periboiler.getStackInSlot(3).display_name         
  23.             end        
  24.                
  25.             if periboiler.getStackInSlot(4) ~= nil then
  26.                 quantite_slot_2 = periboiler.getStackInSlot(4).qty
  27.                 nom_slot_2 = periboiler.getStackInSlot(4).display_name
  28.             end
  29.                
  30.             if periboiler.getStackInSlot(5) ~= nil then
  31.                 quantite_slot_3 = periboiler.getStackInSlot(5).qty
  32.                 nom_slot_3 = periboiler.getStackInSlot(5).display_name
  33.             end
  34.                            
  35.             if periboiler.getStackInSlot(6) ~= nil then
  36.                 quantite_slot_4 = periboiler.getStackInSlot(6).qty
  37.                 nom_slot_4 = periboiler.getStackInSlot(6).display_name
  38.             end
  39.                            
  40.             infos_boiler_solid = periboiler.getTankInfo()
  41.             tableau = infos_boiler_solid[2]
  42.             capacity = tableau.capacity
  43.                    
  44.                    
  45.             if tableau.contents == nil then
  46.                 amount = 0
  47.                 rawName = "Vide"
  48.             else
  49.                 amount = tableau.contents.amount
  50.                 rawName= tableau.contents.rawName
  51.                
  52.             end
  53.                            
  54.             temperature = periboiler.getTemperature()
  55.            
  56.         end
  57.        
  58.        
  59.         ALL = {
  60.             ["name"] = boiler_solid,
  61.             ["Quantite1"] = quantite_slot_1,
  62.             ["Nom1"] = nom_slot_1,
  63.             ["Quantite2"] = quantite_slot_2,
  64.             ["Nom2"] = nom_slot_2,
  65.             ["Quantite3"] = quantite_slot_3,
  66.             ["Nom3"] = nom_slot_3,
  67.             ["Quantite4"] = quantite_slot_4,
  68.             ["Nom4"] = nom_slot_4,
  69.             ["Capacite"] = capacity,
  70.             ["Amount"] = amount,
  71.             ["LiquideName"] = rawName,
  72.             ["Temperature"] = temperature
  73.             }
  74.        
  75.        
  76.     table.insert(Info,pos,ALL)
  77.     end
  78.  
  79.  
  80.  
  81. while true do
  82.     Info = {}
  83.     modem = peripheral.wrap("left")
  84.    
  85.     DisplayBoiler_solid("solid_fueled_boiler_firebox_2",1)
  86.     DisplayBoiler_solid("solid_fueled_boiler_firebox_6",2)
  87.     modem.transmit(1,1,Info)
  88.    
  89.     sleep(5)
  90. end
Advertisement
Add Comment
Please, Sign In to add comment