Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- powerD = peripheral.wrap("draconic_rf_storage_0")
- mon = peripheral.wrap("monitor_2")
- local CurD = 0
- local MaxD = 0
- local PerD = 0
- monX,monY = mon.getSize()
- function WerteD()
- CurD = powerD.getEnergyStored()
- MaxD = powerD.getMaxEnergyStored()
- PerD = math.ceil(CurD/MaxD)
- end
- function writeMonD()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setBackgroundColor(colors.purple)
- mon.setTextColor(colors.white)
- mon.setCursorPos(2,1)
- mon.write(" Draconic:" .. math.ceil((powerD.getEnergyStored()/powerD.getMaxEnergyStored())*100) .. "% Voll")
- end
- function drawBarD()
- barD = math.ceil(((CurD/MaxD)*monX)-2)
- mon.setCursorPos(2,monY-22)
- mon.setBackgroundColor(colors.red)
- mon.write(string.rep(" ", monX-2))
- mon.setCursorPos(2,monY-23)
- mon.setBackgroundColor(colors.red)
- mon.write(string.rep(" ", monX-2))
- mon.setCursorPos(2,monY-22)
- mon.setBackgroundColor(colors.green)
- mon.write(string.rep(" ", barD))
- mon.setCursorPos(2,monY-23)
- mon.setBackgroundColor(colors.green)
- mon.write(string.rep(" ", barD))
- end
- function InputD()
- PowerDra = powerD.getTransferPerTick()
- mon.setCursorPos(2,monY-20)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write("Input:")
- if PowerDra > 0 then
- mon.setTextColor(colors.green)
- mon.write("+" .. PowerDra .. "RF/T")
- else
- mon.setTextColor(colors.red)
- mon.write(PowerDra .. "RF/T")
- end
- end
- function InputCalcD()
- InkRFD = CurD/1000
- InMRFD = math.ceil(InkRFD)/1000
- InGRFD = math.ceil(InMRFD)/1000
- InTRFD = math.ceil(InGRFD)/1000
- mon.setCursorPos(20,monY-20)
- mon.setTextColor(colors.white)
- if CurD > 1000 and CurD < 1000000 then
- mon.write("Stored:" .. InkRFD .. "kRF")
- elseif CurD > 1000000 and CurD < 1000000000 then
- mon.write("Stored:" .. InMRFD .. "MRF")
- elseif CurD > 1000000000 and CurD < 1000000000000 then
- mon.write("Stored:" .. InGRFD .. "GRF")
- elseif CurD > 1000000000000 and CurD < 1000000000000000 then
- mon.write("Stored:" .. InTRFD .. "TRF")
- end
- end
- while true do
- print("running")
- WerteD()
- writeMonD()
- drawBarD()
- InputD()
- InputCalcD()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement