Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local filesystem = require("filesystem")
- local colors = require("colors")
- local component = require("component")
- local term = require("term")
- os.sleep(0.1)
- term.clear()
- gpu = component.gpu
- gpu.setResolution(80,18)
- local fond_barre = 0xdcdcdc
- local barre = 0x21af0e
- local function recuperation()
- rf = component.draconic_rf_storage.getEnergyStored()
- max = component.draconic_rf_storage.getMaxEnergyStored()
- pct = (rf * 100) / max
- tick = component.draconic_rf_storage.getTransferPerTick()
- end
- local function bar_h(bar_x,bar_y,bar_l,pos,bar_h,color_barre,color_fond)
- m = (bar_l/100)
- f = math.floor(pos*m)
- gpu.setBackground(color_barre)
- gpu.fill(bar_x,bar_y,f,bar_h," ")
- gpu.setBackground(color_fond)
- gpu.fill((bar_x+f),bar_y,(bar_l-f),bar_h," ")
- end
- local function activation()
- gpu.setBackground(0xFFFFFF)
- gpu.fill(50,2,12,11," ")
- gpu.setBackground(0x0000FF)
- gpu.fill(64,2,12,11," ")
- end
- local function desactivation()
- end
- local function affichage()
- gpu.setForeground(0xFFFFFF)
- gpu.setBackground(0x000000)
- gpu.set(5,2,"Energie Maximum : "..max.." Rf")
- gpu.set(5,4,"Energie Stockée : "..rf.." Rf")
- gpu.set(5,6,"Transfert : "..tick.." Rf/tick")
- gpu.set(5,8,"Pourcentage : "..pct.." %")
- end
- term.clear()
- while true do
- recuperation()
- affichage()
- bar_h(5,14,70,pct,3,barre,fond_barre)
- activation()
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement