Advertisement
Guest User

startup

a guest
Jul 30th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | None | 0 0
  1. function drawTop()
  2. term.setBackgroundColor(colors.white)
  3. term.clear()
  4. term.setBackgroundColor(colors.red)
  5. term.setCursorPos(1,1)
  6. term.clearLine()
  7. term.setCursorPos(1,1)
  8. write("RedGame - Installer")
  9. term.setTextColor(colors.lightGray)
  10. term.setBackgroundColor(colors.white)
  11. end
  12. doins = true
  13. drawTop()
  14. term.setCursorPos(3,3)
  15. 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..")
  16. sel = 1
  17. opt = {
  18.    
  19.     {name="  Full Install ",run = function()
  20.       drawTop()
  21.       term.setCursorPos(3,3)
  22.       write("Installing....\n")
  23.       if(not fs.exists("RedGame") and not fs.exists("RedLevel"))then
  24.       fs.copy("disk/RedGame","/RedGame")
  25.       fs.copy("disk/RedLevel","/RedLevel")
  26.       print("   Success!\n")
  27.       else
  28.         print("   Already Installed!")
  29.       end
  30.       print("Press Any Key")
  31.       os.pullEvent("key")
  32.       term.setBackgroundColor(colors.black)
  33.       term.setTextColor(colors.white)
  34.       term.setCursorPos(1,1)
  35.       term.clear()
  36.       doins = false
  37.     end};
  38.     {name="Install RedGame ",run=function()
  39.      
  40.     end};
  41.     {name="Install RedLevel",run=function()
  42.      
  43.     end};
  44. }
  45. paintutils.drawFilledBox(10,12,40,18,colors.red)
  46. while doins do
  47. sleep(0.01)
  48.   for i =1, #opt do
  49.     term.setCursorPos(16,i+13)
  50.     term.setBackgroundColor(colors.red)
  51.     if(sel == i)then term.setTextColor(colors.orange) write("  "..opt[i].name.."  ") else
  52.      term.setTextColor(colors.white)
  53.        write("  "..opt[i].name.."  ")
  54.     end
  55.  end
  56.    a = {os.pullEvent("key")}
  57.    key = a[2]
  58.    if(key == keys.up and sel > 1)then sel = sel - 1 end
  59.    if(key == keys.down and sel < #opt)then sel = sel + 1 end
  60.    if(key == keys.enter)then
  61.      term.setCursorPos(18,sel+13)
  62.      term.setTextColor(colors.black)
  63.      write(opt[sel].name)
  64.      sleep(0.3)
  65.      opt[sel].run()
  66.    end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement