Advertisement
MigasRocha

Turbine Energy Regulator Switch /Computer ID:48

Dec 26th, 2024
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | Gaming | 0 0
  1. turbine = peripheral.wrap("back")
  2.  
  3. modem = peripheral.find("modem")
  4.  
  5. ReactorStatus = 0
  6.  
  7. print(ReactorStatus)
  8.  
  9. sleep(10)
  10.  
  11. while true do
  12.  
  13.     if turbine.getEnergyFilledPercentage()*100 <= 10 and ReactorStatus == 0 then
  14.     modem.open(8)
  15.     modem.transmit(8,8)
  16.     term.clear()
  17.     print("Low Energy Activating Reactor")
  18.     modem.close(8)
  19.     ReactorStatus = ReactorStatus + 1
  20.     print(ReactorStatus)
  21. end
  22.  
  23. if turbine.getEnergyFilledPercentage()*100 >= 90 and ReactorStatus ~= 0 then
  24.     print(turbine.getEnergyFilledPercentage()*100)
  25.     modem.open(9)
  26.     modem.transmit(9,9)
  27.     term.clear()
  28.     print("High Energy,Deactivating Reactor")
  29.     modem.close(9)
  30.     ReactorStatus = ReactorStatus - 1
  31.     print(ReactorStatus,"Deactivating")
  32.  
  33. end
  34.  
  35. sleep(0.1)
  36. end
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement