Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this program acts as a Graphical Overlay to make the setup process look nicer
- local tArg = {...}
- term.clear()
- term.setCursorPos(1,1)
- local w, h = term.getSize()
- local Stage = 0
- local Version_1 = "1.0"
- local Version_2 = "2.0"
- local Version_3 = nil
- function CenterText(y,text)
- local x = math.floor((w - string.len(text)) /2)
- term.setCursorPos(x,y)
- term.clearLine()
- term.write(text)
- end
- function SlowCenterText(y,text)
- local x = math.floor((w - string.len(text)) /2)
- term.setCursorPos(x,y)
- term.clearLine()
- textutils.slowWrite(text)
- end
- function DrawBackground()
- term.clear()
- term.setCursorPos(1,1)
- paintutils.drawFilledBox(1,1,w,h,colors.blue)
- paintutils.drawBox(1,1,w,h,colors.gray)
- paintutils.drawPixel(2,2,colors.red)
- end
- function DrawMenu()
- CenterText(2,"--Setup---Menu--")
- term.setCursorPos(1,3)
- if Stage == 0 then
- print("SYSTEM SETUP")
- print("Please Enter your desired version")
- print("1 - "..Version_1)
- print("2 - "..Version_2)
- print("3 - "..Version_3)
- SetupInteraction_1()
- elseif Stage == 1 then
- print("Starting Security Search")
- print("please wait while your ComputerCraft Device is searched")
- print("For any Harmful or insecure Programs")
- CenterText(7,"Security Search")
- SlowCenterText(8,"Searching...Searching...Searching...")
- sleep(1)
- DrawBar(2,10,0.05)
- sleep(2)
- DrawBar(2,10,0.1)
- sleep(1)
- DrawBar(2,10,0.35)
- sleep(2)
- DrawBar(2,10,0.60)
- sleep(4)
- DrawBar(2,10,0.9)
- sleep(2)
- DrawBar(2,10,1)
- sleep(1)
- Centertext(11,"Completed!")
- sleep(2)
- Stage = 2
- elseif Stage == 2 then
- elseif Stage == 3 then
- end
- if Stage < 4 then
- DrawBackground()
- DrawMenu()
- end
- end
- function DrawBar(x,y,Progress)
- local Position = (w-x)*Progress
- paintutils.drawFilledBox(x,y,Position-x,y+3,colors.green)
- end
- function SetupInteraction_1()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.one then
- break
- elseif key == keys.two and Version_2 ~= nil then
- break
- elseif key == keys.three and Version_3 ~= nil then
- break
- end
- end
- end
- if tArg[1] == "Start" then
- Stage = 0
- elseif tArg[1] == "Finished" then
- Stage = 3
- end
- DrawBackGround()
- DrawMenu()
Advertisement
Add Comment
Please, Sign In to add comment