Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rp = require("remotePeripherie")
- local monitor = peripheral.find("monitor") or term
- local core = rp.wrap(15,"bottom")
- local turbine = rp.wrap(24, "right")
- 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,...)
- m.clear()
- for i,v in ipairs(arg) do
- m.setCursorPos(1,i)
- m.write(""..v)
- end
- end
- while true do
- local e = core.getEnergyStored()
- local p = math.floor(100*e / core.getMaxEnergyStored())
- local r = core.getTransferPerTick()
- local s = turbine.getRotorSpeed()
- local tr= turbine.getEnergyProducedLastTick()
- e = niceNrString(e,"rf")
- p = p.." %"
- r = niceNrString(r,"rf/t")
- s = math.floor(s).."rp/m"
- tr= niceNrString(tr,"rf/t")
- toDisplay(monitor, e, p, r, s, tr)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement