Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. local e = peripheral.find("BigReactors-Reactor")
  2. local cube = peripheral.find("draconic_rf_storage")
  3. mon = peripheral.wrap("back")
  4.  
  5.  
  6. function Check()
  7. if e == nil then
  8. print("Big Reactor non detecter")
  9. sleep(5)
  10. end
  11. if cube == nil then
  12. print("Draconic Evolution Storage non detecter")
  13. sleep(5)
  14. end
  15. if e ~= nil and cube ~= nil then
  16. print("Tout est detecter, alimentation des ecrans !")
  17. end
  18. end
  19.  
  20. function clear()
  21. mon.clear()
  22. mon.setTextScale(1)
  23. end
  24.  
  25. function lastFuel() --Fuel Utiliser
  26. local ye = e.getFuelConsumedLastTick()
  27. mon.setCursorPos(1,1)
  28. textColor("white")
  29. mon.write("Mb/t :")
  30. mon.setCursorPos(1,2)
  31. textColor("yellow")
  32. mon.write(ye)
  33. end
  34.  
  35. function lastProduced() --Energy Produit
  36. local en = e.getEnergyProducedLastTick()
  37. mon.setCursorPos(1,3)
  38. textColor("white")
  39. mon.write("RF/t :")
  40. textColor("orange")
  41. mon.setCursorPos(1,4)
  42. mon.write(en)
  43. end
  44.  
  45. function energyStock() --Energy Stocker
  46. local s = cube.getEnergyStored("unknown")
  47. mon.setCursorPos(1,5)
  48. textColor("white")
  49. mon.write("Energie Stocker :")
  50. textColor("cyan")
  51. mon.setCursorPos(1,6)
  52. mon.write(s)
  53. end
  54.  
  55. function energyPercent()
  56. local p = cube.getEnergyStored("unknown")/cube.getMaxEnergyStored("unknown")*100
  57. mon.setCursorPos(1,7)
  58. textColor("white")
  59. mon.write("Pourcentage de Stockage :")
  60. textColor("cyan")
  61. mon.setCursorPos(1,8)
  62. mon.write(p.." %")
  63. sleep(5)
  64. end
  65.  
  66. function textColor(w)
  67.  
  68. if w == "white" then
  69. mon.setTextColor(colors.white)
  70. end
  71. if w == "yellow" then
  72. mon.setTextColor(colors.yellow)
  73. end
  74. if w == "orange" then
  75. mon.setTextColor(colors.orange)
  76. end
  77. if w == "cyan" then
  78. mon.setTextColor(colors.cyan)
  79. end
  80. end
  81.  
  82. function Credit()
  83. textColor("orange")
  84. mon.setCursorPos(1,9)
  85. mon.write("Code par : ")
  86. mon.setCursorPos(1,10)
  87. mon.setTextScale(0,7)
  88. mon.write("Iirothelegend / AristoTvStream")
  89. end
  90.  
  91. Check()
  92.  
  93. while true do
  94.  
  95. clear()
  96. Credit()
  97. lastFuel()
  98. lastProduced()
  99. energyStock()
  100. energyPercent()
  101.  
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement