Advertisement
Guest User

mon.lua

a guest
May 28th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. local furnace = peripheral.find("ic2:electric_furnace")
  2.  
  3. local macerator = peripheral.find("ic2:macerator")
  4.  
  5. local extractor = peripheral.find("ic2:extractor")
  6.  
  7. local mon = peripheral.find("monitor")
  8. mon.setTextScale(0.5)
  9. local fWin = window.create(term.current(),45,1,15,5)
  10. local mWin = window.create(term.current(),65,1,15,5)
  11. local eWin = window.create(term.current(),85,1,15,5)
  12.  
  13.  
  14. term.redirect(mon)
  15. while true do
  16.     local input = furnace.getItem(7)
  17.     local output = furnace.getItem(2)
  18.  
  19.     local input2 = macerator.getItem(7)
  20.     local output2 = macerator.getItem(2)
  21.  
  22.     local input3 = extractor.getItem(7)
  23.     local output3 = extractor.getItem(2)
  24.    
  25.     if input then
  26.         input = input.getMetadata()
  27.     end
  28.  
  29.     if input2 then
  30.         input2 = input2.getMetadata()
  31.     end
  32.  
  33.     if input3 then
  34.         input3 = input3.getMetadata()
  35.     end
  36.  
  37.     if output then
  38.         output = output.getMetadata()
  39.     end
  40.  
  41.     if output2 then
  42.         output2 = output2.getMetadata()
  43.     end
  44.  
  45.     if output3 then
  46.         output3 = output3.getMetadata()
  47.     end
  48.    
  49.     term.redirect(mon)
  50.     fWin.clear()
  51.     mWin.clear()
  52.     eWin.clear()
  53.  
  54.     term.redirect(fWin)
  55.     term.setCursorPos(1,1)
  56.     print("E-Furnace")
  57.     if input then
  58.         print("I: "..(input.displayName or "").." "..(input.count and "x"..input.count or ""))
  59.     end
  60.     if output then
  61.         print("O: "..(output.displayName or "").." "..(output.count and "x"..output.count or ""))
  62.     end
  63.  
  64.    
  65.     term.redirect(mWin)
  66.     term.setCursorPos(1,1)
  67.     print("Macerator")
  68.     if input2 then
  69.         print("I: "..(input2.displayName or "").." "..(input2.count and "x"..input2.count or ""))
  70.     end
  71.     if output2 then
  72.         print("O: "..(output2.displayName or "").." "..(output2.count and "x"..output2.count or ""))
  73.     end
  74.  
  75.     term.redirect(eWin)
  76.     term.setCursorPos(1,1)
  77.     print("Extractor")
  78.     if input3 then
  79.         print("I: "..(input3.displayName or "").." "..(input3.count and "x"..input3.count or ""))
  80.     end
  81.     if output3 then
  82.         print("O: "..(output3.displayName or "").." "..(output3.count and "x"..output3.count or ""))
  83.     end
  84.    
  85.    
  86.     sleep(0.1)
  87. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement