Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --set everything up. load APIs, wrap peripherals, set up variables
- os.loadAPI("lazy")
- glass = peripheral.wrap(lazy.find("openperipheral_bridge"))
- nuke = peripheral.wrap(lazy.find("BigReactors-Reactor"))
- local delay = 0.25 --so I don't have to scroll
- glass.getSurfaceByName("Basedsmz")
- --colors
- white = colors.white
- yellow = colors.yellow
- red = colors.red
- cyan = colors.cyan
- grey = colors.gray
- opacity = 0.5
- --=====FUNCTIONS=====
- --meter - draw a horizontal level meter to screen
- --takes six arguments
- -- x: horizontal position, from top left
- -- y: vertical position from top left
- -- value: the part bit that gets filled in
- -- maxValue: the maximum amount of filled in bit
- -- fgColor: color for the "full" portion of the bar
- -- bgColor: color for the "empty" portion of the bar
- function meter(x,y,val,maxVal,fgColor,bgColor)
- local valPercent = lazy.roundPercent(val,maxVal)
- glass.addBox(x,y,100,8,bgColor,1)
- glass.addBox(x,y,valPercent,8,fgColor,1)
- end
- --=====END=====
- while true do
- glass.clear()
- --redraw the background box
- glass.addBox(13,13,150,35,grey,opacity)
- --draw the meters and info
- meter(15,15,nuke.getFuelAmount(),nuke.getFuelAmountMax(),yellow,red) --draw the fuel bar
- glass.addText(117,15,lazy.roundPercent(nuke.getFuelAmount(),nuke.getFuelAmountMax(),1).."%",white) --output the fuel amount
- meter(15,26,nuke.getWasteAmount(),1000,cyan,yellow) --draw the waste bar
- glass.addText(117,26,nuke.getWasteAmount().."mB",white)
- --just text here
- glass.addText(15,37,lazy.round(nuke.getEnergyProducedLastTick(),1).."RF/t",white)
- glass.addText(115,37,lazy.round(nuke.getFuelTemperature(),1).."C",white)
- glass.sync()
- sleep(delay)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement