Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- br = peripheral.wrap("top") --Terminal Glasses Swag
- bb = peripheral.wrap("batbox_2") -- Batbox
- function bbPower()
- bbLevel = tostring(bb.getStored()) --Gets Energy level in batbox
- local bbString = br.getStringWidth(bbLevel) --Gets how long the EU 'text' is
- if tonumber(bb.getStored()) > 5 then --If the Eu is More than 5 then
- br.addText(5, 90, "Batbox:", 0x00158F) -- These lines will display how much EU there is with:
- br.addText(45, 90, bbLevel, 0x00FF2F) -- BatBox: 38543 EU
- br.addText(47 + bbString, 90, " EU", 0x00158F)
- else
- br.addText(5, 90, "No Energy in Batbox!", 0x00158F) -- If the EU is less than 5
- -- then this will display
- -- "No Energy in batbox!"
- end
- end
- while true do -- THis little snipit auto-updates how much Eu there is on the HUD
- br.clear() --Clears the glasses
- bbPower() -- Re-Shows the EU
- sleep(0.1) -- How fast it updates
- end
Advertisement
Add Comment
Please, Sign In to add comment