SHARE
TWEET

Big Reactors: Regular Reactor (OpenComputers)

scadl Nov 30th, 2019 (edited) 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Simple Big Reactors Regular Reactor control: Power only if discahrged
  2.  
  3. local component = require("component")
  4. local event = require("event")
  5. local reactor = component.getPrimary("br_reactor")
  6. local monitor = component.getPrimary("screen")
  7.  
  8. os.execute("resolution 25 7")
  9.  
  10. repeat
  11.  
  12. os.execute("cls")
  13. print('BR Reactor:')
  14. print('--------')
  15. print('STATE: '..tostring(reactor.getActive()))
  16.  
  17. local chprc = (reactor.getEnergyStored()*100)/10000000
  18. print('CHARGE: '..math.ceil(reactor.getEnergyStored()).."RF - "..math.ceil(chprc).."%")
  19. print('FUEL/WASTE: '..math.ceil(reactor.getFuelAmount())..'/'..math.ceil(reactor.getWasteAmount())..'mB')
  20. print('--------')
  21. print("Stop: Ctrl+С")
  22.  
  23. if reactor.getEnergyStored() < 2000000
  24. then
  25.   reactor.setActive(true)
  26. end
  27. if reactor.getEnergyStored() > 9500000
  28. then
  29.   reactor.setActive(false)
  30. end
  31.  
  32. os.execute("sleep "..tonumber(5))
  33.  
  34. until event.pull(1)
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