Advertisement
Guest User

startup

a guest
Aug 30th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. term.setBackgroundColor(colors.white)
  2. shell.run("clear")
  3. term.setCursorPos(1,1)
  4. term.setTextColor(colors.blue)
  5. term.setBackgroundColor(colors.gray)
  6. print("AppleOS v3.3 ")
  7.  
  8. function AppleSHELL()
  9.   term.setCursorPos(1,1)
  10.   term.setBackgroundColor(colors.black)
  11.   term.setTextColor(colors.red)
  12.   shell.run("clear")
  13.   print("AppleOS SHELL type in Exit() to exit")
  14.   term.setTextColor(colors.blue)
  15.   write("> ")
  16.   input = read()
  17.   shell.run(input)
  18.   sleep(2)
  19.   os.reboot()
  20. end
  21.  
  22. function drawMenu1()
  23.     term.setCursorPos(1,2)
  24.     term.setTextColor(colors.blue)
  25.     term.setBackgroundColor(colors.gray)
  26.     print("             ")
  27.     term.setCursorPos(1,3)
  28.     print("#############")
  29.     term.setCursorPos(1,4)
  30.     print("AppleOS SHELL")
  31.     term.setCursorPos(1,5)
  32.     print("Restart      ")
  33.     term.setCursorPos(1,6)
  34.     print("#############")
  35. end
  36.  
  37. function drawDesktop()
  38.     apple = paintutils.loadImage(".background")
  39.     paintutils.drawImage(apple,1,1)
  40. end
  41.  
  42. drawDesktop()
  43.  
  44. function button3()
  45.   while true do
  46.     local event, button, X, Y = os.pullEventRaw()
  47.       if(event == "mouse_click") then
  48.         if(slc == 1) then
  49.           if(X >=1 and X <=7 and Y==5 and button ==1) then
  50.             os.reboot()
  51.            
  52.             else
  53.              
  54.             os.reboot()
  55.             end
  56.         end
  57.      end
  58.   end
  59. end
  60.  
  61.  
  62. function button2()
  63.   while true do
  64.       local event, button, X, Y = os.pullEventRaw()
  65.         if(event == "mouse_click") then
  66.           if(slc == 1) then
  67.             if(X >=1 and X <=13 and Y==4 and button ==1) then
  68.               AppleSHELL()
  69.                
  70.               else
  71.                
  72.               os.reboot()
  73.               end
  74.          
  75.         end
  76.      end
  77.   end
  78. end
  79.  
  80.  
  81.  
  82. slc = 0
  83.  
  84. function button1()
  85.     while true do
  86.         local event, button, X, Y = os.pullEventRaw()
  87.           if(event == "mouse_click") then
  88.             if(slc == 0) then
  89.               if(X >=1 and X <=12 and Y==1 and button == 1) then
  90.                 slc = 1
  91.                 drawMenu1()
  92.                 button2()
  93.                 button3()
  94.                
  95.                 else
  96.                
  97.                 shell.run("test")
  98.               end
  99.         end
  100.      end
  101.   end
  102. end
  103. button1()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement