Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n=peripheral.wrap("bottom")
- a,b,c,d=n.get(1)
- m=peripheral.wrap("top")
- m.setTextColor(1)
- m.setTextScale(1)
- while true do
- a,b,c,d=n.get(1)
- x=30/d["maxStorageL"]*d["energyL"]
- pro=100/d["maxStorageL"]*d["energyL"]
- y=0
- 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:"..d["energyL"])
- m.setCursorPos(1,3)
- m.write("Maximale Energie:"..d["maxStorageL"])
- 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
- while y<x do
- m.write(" ")
- y=y+1
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement