SHARE
TWEET

turbina

QuicksilverBoy Jun 1st, 2020 697 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component = require("component")
  2.  
  3. if not component.isAvailable("br_turbine") then
  4.     io.stderr:write("No connected turbine")
  5.     os.exit()
  6. end
  7.  
  8. local listTur = component.list("br_turbine")
  9.  
  10. local function chekTurbine(address)
  11.     local tur = component.proxy(address)
  12.     if tur.getRotorSpeed()<1780.0 then
  13.         tur.setInductorEngaged(false)
  14.     else
  15.         tur.setInductorEngaged(true)
  16.     end
  17. end
  18.  
  19. repeat
  20.     for i in pairs(listTur) do
  21.         chekTurbine(i)
  22.     end
  23.     os.sleep(10)
  24. until false
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top