Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("draconic_rf_storage_2")
- local m = peripheral.wrap("right")
- local t = p.getMaxEnergyStored()
- local e_pre = 0
- --functions
- function getPercent(x,y)
- return x * 100 / y
- end
- function newLine(n)
- pos = {m.getCursorPos()}
- m.setCursorPos(1,pos[2]+n)
- end
- function clrScr()
- m.clear()
- m.setCursorPos(1,1)
- end
- --main program
- while true do
- local e = p.getEnergyStored()
- clrScr()
- m.write("Energy in core: "..e.."/"..t)
- newLine(1)
- m.write("Percentage: "..getPercent(e,t).."%")
- newLine(2)
- m.write("RF/tick: "..e-e_pre)
- e_pre = e
- sleep(0.05)
- end
Add Comment
Please, Sign In to add comment