skare

Untitled

Dec 3rd, 2018
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. local component = require("component")
  2. local reactor = component.reactor
  3. local computer = require("computer")
  4. local sides= require("sides")
  5. local term = require("term")
  6. local gpu = component.gpu
  7. local tempcolor=0x00FF00
  8. gpu.setBackground(tempcolor)
  9. gpu.setForeground(0x000000)
  10. gpu.setResolution(50, 25)
  11. --component.redstone.setOutput(sides.left, 10)
  12. local function centerF(row, msg, ...)
  13. local mLen = string.len(msg)
  14. w, h = gpu.getResolution()
  15. term.setCursor((w - mLen)/2,row)
  16. print(msg:format(...))
  17. end
  18.  
  19.  
  20. while true do
  21. print(reactor.getHeat())
  22. term.clear()
  23. term.setCursor(1,1)
  24. centerF(4, "RAPPEL, TENUE OBLIGATOIRE AVANT D'ENTRER !")
  25. centerF(5, "-----------------------------------------")
  26. centerF(6, "- Cubicorn Nuclear Control -")
  27. centerF(7, "-----------------------------------------")
  28. centerF(8, string.format("- Reacteur allumée: %s -",reactor.producesEnergy()))
  29. centerF(9, string.format("- Reacteur temp max: %s -",reactor.getMaxHeat()))
  30. centerF(10, string.format("- Reacteur temperature: %s -", reactor.getHeat()))
  31. centerF(11, string.format("- Reacteur EU Output: %s -", reactor.getReactorEUOutput()))
  32. centerF(12, "-----------------------------------------")
  33. centerF(13, "- -")
  34. centerF(14, "-----------------------------------------")
  35. centerF(15, "RAPPEL, TENUE OBLIGATOIRE AVANT D'ENTRER !")
  36. if (reactor.getHeat() > 1000)
  37. then
  38. --component.redstone.setOutput(sides.right, 0)
  39. --component.redstone.setOutput(sides.front, 15)
  40. os.sleep(1)
  41. --component.redstone.setOutput(sides.front, 0)
  42. term.clear()
  43. term.setCursor(1,1)
  44. local backcolor=0xFF0000
  45. gpu.setBackground(backcolor)
  46. centerF(5, "-----------------------------------------")
  47. centerF(6, "- Cubicorn Nuclear Control -")
  48. centerF(7, "-----------------------------------------")
  49. centerF(8, "-------ENTER SECURITY MODE------")
  50. centerF(9, "-------ENTER SECURITY MODE------")
  51. centerF(10, "-------ENTER SECURITY MODE------")
  52. centerF(11, "-------ENTER SECURITY MODE------")
  53. centerF(12, "-------ENTER SECURITY MODE------")
  54. centerF(13, "-------ENTER SECURITY MODE------")
  55. centerF(14, "-------ENTER SECURITY MODE------")
  56. --component.redstone.setOutput(sides.right, 10)
  57. computer.beep()
  58. end
  59. os.sleep(5)
  60. end
Advertisement
Add Comment
Please, Sign In to add comment