Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("monitor_0");
- local rec = peripheral.wrap("left");
- local isActive = false;
- local energyStored = 0;
- mon.setBackgroundColor(colors.black);
- mon.clear();
- mon.setTextScale(0.5);
- mon.setCursorPos(0,1);
- mon.setTextColor(colors.red);
- mon.write(" Offline");
- mon.setCursorPos(3,4);
- mon.setBackgroundColor(colors.red);
- mon.write(" ");
- mon.setCursorPos(0,6);
- mon.setBackgroundColor(colors.black);
- mon.setTextColor(colors.orange);
- mon.write(energyStored.."rF");
- mon.setCursorPos(0,7);
- mon.setBackgroundColor(colors.green);
- mon.setTextColor(colors.orange);
- mon.write(10000000-energyStored.." free");
- while true do
- isActive = rec.getActive();
- energyStored = rec.getEnergyStored();
- if isActive == true then
- mon.setBackgroundColor(colors.black);
- mon.setCursorPos(0,1);
- mon.setTextColor(colors.green);
- mon.write( Online);
- mon.clear();
- end
- if isActive == false then
- mon.setBackgroundColor(colors.black);
- mon.setCursorPos(0,1);
- mon.setTextColor(colors.red);
- mon.write( Offline);
- end
- mon.setCursorPos(3,4);
- if(energyStored > 999999 and energyStoed < 2000000) then
- mon.setBackgroundColor(colors.red);
- mon.write(" ");
- end
- if(energyStored > 1999999 and energyStored < 3000000) then
- mon.setBackgroundColor(colors.red);
- mon.write(" ");
- end
- mon.setCursorPos(3,6)
- if(energyStored > 2999999 and energyStored < 4000000) then
- mon.setBackgroundColor(colors.orange);
- mon.write(" ");
- end
- if(energyStored > 3999999 and energyStored < 5000000) then
- mon.setBackgroundColor(colors.orange);
- mon.write(" ");
- end
- if(energyStored > 4999999 and energyStored < 6000000) then
- mon.setBackgroundColor(colors.orange);
- mon.write(" ");
- end
- mon.setCursorPos(3,9);
- if(energyStored > 5999999 and energyStored < 7000000) then
- mon.setBackgroundColor(colors.green);
- mon.write(" ");
- end
- if(energyStored > 6999999 and energyStored < 8000000) then
- mon.setBackgroundColor(colors.green);
- mon.write(" ");
- end
- if(energyStored > 7999999 and energyStored < 9000000) then
- mon.setBackgroundColor(colors.green);
- mon.write(" ");
- end
- if(energyStored > 8999999 and energyStored < 1000001) then
- mon.setBackgroundColor(colors.cyan);
- mon.write(" ");
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement