Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n1=peripheral.wrap("bottom")
- n2=peripheral.wrap("left")
- n3=peripheral.wrap("right")
- n4=peripheral.wrap("back")
- function getEnergy()
- energy=0
- max=0
- zc=1
- while zc<=9 do
- a,b,c,d=n1.get(zc) a1,b1,c1,d1=n2.get(zc) a2,b2,c2,d2=n3.get(zc) a3,b3,c3,d3=n4.get(zc)
- energy=energy+d["energyL"] energy=energy+d1["energyL"] energy=energy+d2["energyL"] energy=energy+d3["energyL"]
- max=max+d["maxStorageL"] max=max+d1["maxStorageL"] max=max+d2["maxStorageL"] max=max+d3["maxStorageL"]
- zc=zc+1
- end
- end
- m=peripheral.wrap("top")
- m.setTextColor(1)
- m.setTextScale(1)
- while true do
- getEnergy()
- x=30/max*energy
- pro=100/max*energy
- m.setBackgroundColor(32768)
- m.clear()
- m.setTextColor(1)
- m.setCursorPos(1,1)
- m.write(pro)m.setCursorPos(4,1)m.write("% ")
- m.setCursorPos(1,2)
- m.write("Aktuelle Energie:"..energy)
- m.setCursorPos(1,3)
- m.write("Maximale Energie:"..max)
- m.setCursorPos(1,5)
- if pro<20 then m.setBackgroundColor(16384) end
- if pro>20 and pro<60 then m.setBackgroundColor(2) end
- if pro>60 then m.setBackgroundColor(32) end
- y=0
- while y<x do
- m.write(" ")
- y=y+1
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement