Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rp = require("remotePeripherie")
- monitor = peripheral.find("monitor")
- local core = rp.wrap(15,"bottom")
- local function niceNrString(n,m)
- local metrics = {[0]="","k","M","G","T","P"}
- local im = 0
- while #(""..n) > 4 and (#metrics -1) > im do
- n = math.floor(n/1000)
- im = im + 1
- end
- return n.." "..metrics[im]..m
- end
- local function toDisplay(m,a,b,c)
- a = a or "--"
- b = b or "--"
- c = c or "--"
- m = m or term
- m.clear()
- m.setCursorPos(1,1)
- m.write(""..a)
- m.setCursorPos(1,2)
- m.write(""..b)
- m.setCursorPos(1,3)
- m.write(""..c)
- end
- while true do
- local e = core.getEnergyStored()
- local p = math.floor(100*e / core.getMaxEnergyStored())
- local r = core.getTransferPerTick()
- e = niceNrString(e,"rf")
- p = p.." %"
- r = niceNrString(r,"rf/t")
- toDisplay(monitor, e, p, r)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement