Advertisement
Guest User

reactor

a guest
Aug 11th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_0");
  2. local rec = peripheral.wrap("left");
  3.  
  4. local isActive = false;
  5. local energyStored = 0;
  6.  
  7. mon.setBackgroundColor(colors.black);
  8. mon.clear();
  9. mon.setTextScale(0.5);
  10. mon.setCursorPos(0,1);
  11. mon.setTextColor(colors.red);
  12. mon.write("     Offline");
  13.  
  14. mon.setCursorPos(3,4);
  15. mon.setBackgroundColor(colors.red);
  16. mon.write("          ");
  17.  
  18. mon.setCursorPos(0,6);
  19. mon.setBackgroundColor(colors.black);
  20. mon.setTextColor(colors.orange);
  21. mon.write(energyStored.."rF");
  22.  
  23. mon.setCursorPos(0,7);
  24. mon.setBackgroundColor(colors.green);
  25. mon.setTextColor(colors.orange);
  26. mon.write(10000000-energyStored.." free");
  27.  
  28. while true do
  29. isActive = rec.getActive();
  30. energyStored = rec.getEnergyStored();
  31. if isActive == true then
  32. mon.setBackgroundColor(colors.black);
  33. mon.setCursorPos(0,1);
  34. mon.setTextColor(colors.green);
  35. mon.write(      Online);
  36. mon.clear();
  37. end
  38. if isActive == false then
  39. mon.setBackgroundColor(colors.black);
  40. mon.setCursorPos(0,1);
  41. mon.setTextColor(colors.red);
  42. mon.write(     Offline);
  43. end
  44.  
  45. mon.setCursorPos(3,4);
  46. if(energyStored > 999999 and energyStoed < 2000000) then
  47. mon.setBackgroundColor(colors.red);
  48. mon.write(" ");
  49. end
  50. if(energyStored > 1999999 and energyStored < 3000000) then
  51. mon.setBackgroundColor(colors.red);
  52. mon.write("  ");
  53. end
  54. mon.setCursorPos(3,6)
  55. if(energyStored > 2999999 and energyStored < 4000000) then
  56. mon.setBackgroundColor(colors.orange);
  57. mon.write(" ");
  58. end
  59. if(energyStored > 3999999 and energyStored < 5000000) then
  60. mon.setBackgroundColor(colors.orange);
  61. mon.write("  ");
  62. end
  63. if(energyStored > 4999999 and energyStored < 6000000) then
  64. mon.setBackgroundColor(colors.orange);
  65. mon.write("   ");
  66. end
  67. mon.setCursorPos(3,9);
  68. if(energyStored > 5999999 and energyStored < 7000000) then
  69. mon.setBackgroundColor(colors.green);
  70. mon.write(" ");
  71. end
  72. if(energyStored > 6999999 and energyStored < 8000000) then
  73. mon.setBackgroundColor(colors.green);
  74. mon.write("  ");
  75. end
  76. if(energyStored > 7999999 and energyStored < 9000000) then
  77. mon.setBackgroundColor(colors.green);
  78. mon.write("  ");
  79. end
  80. if(energyStored > 8999999 and energyStored < 1000001) then
  81. mon.setBackgroundColor(colors.cyan);
  82. mon.write(" ");
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement