Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- local mon = peripheral.wrap("top")
- local cell = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_5")
- glass = peripheral.wrap("left")
- Energy = cell.getEnergyStored()
- Max = cell.getMaxEnergyStored()
- Ratio = (Energy/Max)
- mon.clear()
- glass.clear()
- if Energy >= 1000000 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("EnergyStored: ")
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.yellow)
- mon.write(math.ceil(Energy/1000000).."mRF/"..math.ceil(Max/1000000).."mRF")
- glass.addText(1,1,"EnergyStored: "..math.ceil(Energy/1000000).."mRF/"..math.ceil(Max/1000000).."mRF")
- else
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("EnergyStored: ")
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.yellow)
- mon.write(math.ceil(Energy).."RF/"..math.ceil(Max/1000000).."mRF")
- glass.addText(1,1,"EnergyStored: "..math.ceil(Energy).."RF/"..math.ceil(Max/1000000).."mRF")
- end
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Percent Full: ")
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.red)
- mon.write(math.ceil(Ratio*100))
- glass.addText(1,10,"Percent Full: "..math.ceil(Ratio*100))
- glass.sync()
- os.startTimer(0.5)
- local event = os.pullEvent()
- if event == "key" then
- break
- else
- event = ""
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment