Advertisement
Guest User

Untitled

a guest
Jul 17th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local copmponent = require("component")
  2. local term = require("term")
  3. local a = {}
  4. local i = 0
  5. local lowEnergy = 1
  6. local highEnergy = 90000000
  7. local critEnergy = 80000000
  8.  
  9. a[1] = component.get("1e041384-fc3c-42f4-8bdf-a53739a3a4d4")
  10. a[2] = component.get("43997802-4b78-4d3b-825f-a9a89ecec343")
  11. a[3] = component.get("957dc433-bf68-4bdf-b838-1b6b12b2f687")
  12. a[4] = component.get("74af7b61-905a-4232-8faa-6fa7b730d313")
  13. a[5] = component.get("cab188aa-11f5-431c-a2ab-998056e95a83")
  14.  
  15. function status(local i)
  16. if a[i].getActive() == true then
  17. x = true
  18. end
  19.  
  20. if a[].getActive() == false then
  21. x = false
  22. end
  23. return x
  24. end
  25.  
  26. local j = 1
  27. while j < 5 do
  28. a[j].setActive(true)
  29. j = j+1
  30. end
  31.  
  32. while true do
  33. if a[i].getEnergyStored() < lowEnergy then
  34. a[i].setActive (true)
  35. end
  36.  
  37. if a[i].getEnergyStored() == critEnergy then
  38. term.write("Reached Critical Energy!")
  39. end
  40.  
  41. if a[i].getEnergyStored() > highEnergy then
  42. a[i].setActive (false)
  43. end
  44.  
  45. print ("Reactor Status:" .. status() )
  46. print ("Reactor Energy:" .. a[i].getEnergyStored() )
  47. print ("Reactor Case Temp:" .. a[i].getCasingTemperature() )
  48. print ("Reactor Fuel Level:" .. a[i].getGuelAmount() )
  49.  
  50. os.sleep(1)
  51. term.clear()
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement