Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bridge = peripheral.wrap("left")
- bridge.clear()
- width = 200
- x = 0
- capacity = 40000000
- amount = 0
- msg = ""
- message = ""
- value = 0
- mfsu0e = 1
- mfsu2e = 1
- local storageUnits = {
- {
- ["id"] = "mfsu_0",
- ["name"] = "Main Energy"
- }
- }
- local offset = 0
- for key, storageUnit in pairs(storageUnits) do
- pxOffset = offset * 20
- storageUnit["label"] = bridge.addText(4, 4 + pxOffset, storageUnit["name"], 0x000000)
- storageUnit["bar"] = bridge.addBox(4, 14 + pxOffset, 0, 5, 0xCC0000, 0.9)
- -- storageUnit["bar"].setZIndex(2)
- storageUnit["bg"] = bridge.addBox(4, 14 + pxOffset, width, 5, 0x000000, 0.5)
- offset = offset + 1
- end
- while true do
- for i=#storageUnits,1,-1 do
- widht = 200
- storageUnit = storageUnits[i]
- storageUnit["bar"].setWidth(width / capacity * amount)
- write("W"..tostring(widht))
- write("C"..tostring(capacity))
- write("A"..tostring(amount))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement