Advertisement
maxtorcd55

batt1

Apr 3rd, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. moni = peripheral.wrap("left")
  2. local maxEU
  3. local localEU
  4. local count
  5. while (true) do
  6.     p = peripheral.wrap("back")
  7.     t = p.getNamesRemote()
  8.     moni.clear()
  9.     moni.setCursorPos(1,1)
  10.     maxEU = 0
  11.     localEU = 0
  12.     count = 0
  13.     for i = 1, #t do
  14.         moni.setCursorPos(1,i)
  15.         info = p.getMethodsRemote(t[i])
  16.         moni.write("eu" ..i ..": " ..p.callRemote(t[i], "getEUStored"))
  17.         maxEU = maxEU + p.callRemote(t[i], "getEUStored")
  18.         localEU = localEU + p.callRemote(t[i], "getEUStored")
  19.         count = count + 1
  20.     end
  21.     moni.setCursorPos(1,25)
  22.     procent = string.format("store: %02d%%", (localEU/(40000000*count)*100))
  23.     moni.write(localEU.."/"..maxEU)
  24.     moni.setCursorPos(1,26)
  25.     moni.write(procent)
  26.     sleep(20)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement