Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawTop()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setBackgroundColor(colors.red)
- term.setCursorPos(1,1)
- term.clearLine()
- term.setCursorPos(1,1)
- write("RedGame - Installer")
- term.setTextColor(colors.lightGray)
- term.setBackgroundColor(colors.white)
- end
- doins = true
- drawTop()
- term.setCursorPos(3,3)
- write("Welcome to the offical RedGame installer! \n This installer will install the following.... \n\n RedGame - Your all in one Game API! \n RedLevel - A Cool Level Editor! \n\n Please Select And Option Below..")
- sel = 1
- opt = {
- {name=" Full Install ",run = function()
- drawTop()
- term.setCursorPos(3,3)
- write("Installing....\n")
- if(not fs.exists("RedGame") and not fs.exists("RedLevel"))then
- fs.copy("disk/RedGame","/RedGame")
- fs.copy("disk/RedLevel","/RedLevel")
- print(" Success!\n")
- else
- print(" Already Installed!")
- end
- print("Press Any Key")
- os.pullEvent("key")
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.clear()
- doins = false
- end};
- {name="Install RedGame ",run=function()
- end};
- {name="Install RedLevel",run=function()
- end};
- }
- paintutils.drawFilledBox(10,12,40,18,colors.red)
- while doins do
- sleep(0.01)
- for i =1, #opt do
- term.setCursorPos(16,i+13)
- term.setBackgroundColor(colors.red)
- if(sel == i)then term.setTextColor(colors.orange) write(" "..opt[i].name.." ") else
- term.setTextColor(colors.white)
- write(" "..opt[i].name.." ")
- end
- end
- a = {os.pullEvent("key")}
- key = a[2]
- if(key == keys.up and sel > 1)then sel = sel - 1 end
- if(key == keys.down and sel < #opt)then sel = sel + 1 end
- if(key == keys.enter)then
- term.setCursorPos(18,sel+13)
- term.setTextColor(colors.black)
- write(opt[sel].name)
- sleep(0.3)
- opt[sel].run()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement