Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Define Variables
- local component = require("component") --Require/Load Component API
- local unicode = require("unicode") --Require/Load Unicode API
- local gpu = component.gpu --Assign "gpu" as the handle for the gpu
- local wres,hres = component.gpu.getResolution() --Assign wres,hres to the current width and height of the display.
- --setPixel - Sets a pixel to a specific colour, and sets text
- function setPixel(xpos,ypos,color,letter)
- if unicode.len(letter) <= 1 then
- gpu.setBackground(color)
- gpu.set(xpos,ypos,letter)
- gpu.setBackground(0x000000)
- else
- error("Too Long")
- end
- end
- --drawBar - Draws bar across the screen at the specified height
- function drawBar(ypos,color)
- for i=1,wres do
- setPixel(i,ypos,color," ")
- end
- end
- --Script, Not API Function
- drawBar(1,0x666666)
- gpu.setForeground(0xff3300)
- setPixel(wres-1,1,0x666666,●)
- gpu.setForeground(0xff9933)
- setPixel(wres-3,1,0x666666,●)
- gpu.setForeground(0xffffff)
Advertisement
Add Comment
Please, Sign In to add comment