Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wrapPs(peripheralName)
- periTab={}
- sideTab={}
- if peripheralName==nil then
- print("Fehler")
- end
- local peripherals = peripheral.getNames()
- local i2 = 1
- for i =1, #peripherals do
- if peripheral.getType(peripherals[i])==peripheralName then
- periTab[i2]=peripheral.wrap(peripherals[i])
- sideTab[i2]=peripherals[i]
- i2=i2+1
- end
- end
- if periTab~={} then
- return periTab,sideTab
- else
- return nil
- end
- end
- delay=1
- e=wrapPs("tile_blockcapacitorbank_name")
- m,mSide=wrapPs("monitor")
- xMax,yMax=m[1].getSize()
- while true do
- charge=0
- maxCharge=0
- for i=1,#e do
- charge=charge+e[i].getEnergyStored()
- maxCharge=maxCharge+e[i].getMaxEnergyStored()
- end
- fp=fs.open("screen","w")
- fp.write("term.setBackgroundColor(colors.black) term.clear() term.setBackgroundColor(colors.green) paintutils.drawFilledBox(1,1,"..xMax/maxCharge*charge..","..yMax..")")
- fp.close()
- shell.run("monitor "..mSide[1].." screen")
- term.clear()
- sleep(delay)
- end
Add Comment
Please, Sign In to add comment