Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gen = peripheral.wrap('left')
- local nM = gen.getMaxEnergyStored('unknown')
- function Inf()
- nE = gen.getEnergyStored('unknown')
- nP = math.floor((nE/nM)*100)
- energy = (nE.."/"..nM.." "..nP.."%")
- clock = textutils.formatTime(os.time(),false)
- end
- if nE == nil then nE = 0 end
- while true do
- term.setCursorPos(1,1)
- local nEo = nE or 0
- Inf()
- if nEo < nE then
- print("Charging ")
- elseif nEo > nE then
- print("Discharging")
- else
- print("No change ")
- end
- print(clock.." ")
- print(energy.." ")
- sleep(1)
- if nE < 1 then
- redstone.setOutput('left',false)
- elseif nE >= nM then
- redstone.setOutput('left',true)
- end
- end
Add Comment
Please, Sign In to add comment