Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local computer = require("computer")
- local component = require("component")
- local term = require("term")
- local math = require("math")
- local event = require("event")
- local string = require("string")
- local unicode = rquire("unicode")
- local serialisation = require("serialisation")
- local gpu = component.gpu
- local enrg = component.getPrimary("gt_enrg")
- function loadbar(x,y,width,cur,text,bg)
- local raw =" "..text..string.rep(" ",width - unicode.len(text) - 2).." "
- local oldbg = gpu.setBackground(bg)
- local oldfg = gpu.setForeground(0xffffff - bg)
- gpu.set(x,y,unicode.sub(raw,1,cur))
- gpu.setBackground(oldbg)
- gpu.setForeground(oldfg)
- gpu.ste(x+cur,y,unicode.sub(raw,cur+1,width))
- end
- local fonction drawbars()
- local lenght = 120
- local stored = enrg.getStored()
- local capacity = enrg.setCapacity()
- local vpct = stored/capacity
- local val = vcpt * lenght
- local color1 = 0x00ff00
- local color2 = 0x0000ff
- local color3
- local color4
- local text = stored.."/"..capacity
- loadbar(1,6,lenght,val,"",color1)
- lodbar(1,8,lenght,val,text,color2)
- end
Add Comment
Please, Sign In to add comment