Advertisement
Guest User

startup

a guest
Sep 2nd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.44 KB | None | 0 0
  1. --[[
  2.     CraftOS 6.0+ Startup file, used to boot
  3.     the System safely and properly, removing
  4.     this will result in a broken Computer
  5. --]]
  6.  
  7. if fs.exists("Installer") == true then
  8.  shell.run("Installer")
  9. else
  10. end
  11.  
  12. version = fs.open("CraftOS/Version","r")
  13.  if version then
  14.  version1 = version.readLine()
  15.  end
  16.  
  17. ID = os.getComputerID()
  18.  
  19. local function s(...) return sleep(...) end
  20. local function w(...) return write(...) end
  21. local function p(...) return print(...) end
  22. local function tw(...) return term.write(...) end
  23. local function scp(...) return term.setCursorPos(...) end
  24. local function sbc(...) return term.setBackgroundColor(...) end
  25. local function stc(...) return term.setTextColor(...) end
  26. local function tc(...) return term.clear(...) end
  27. local function tcl(...) return term.clearLine() end
  28. local function scb(...) return term.setCursorBlink(...) end
  29. local function ts(...) return term.scroll(...) end
  30. local function r(...) return shell.run(...) end
  31. local function para(...) return parallel.waitForAny(...) end
  32. local function sw(...) return textutils.slowWrite(...) end
  33. local function sp(...) return textutils.slowPrint(...) end
  34. -- ########################## -- Einstellungen -- ############################ --
  35. os.pullEvent = os.pullEventRaw
  36. OfficialVersion = "3.0"
  37. loopbreak2 = 0
  38. sbc(32768)
  39. stc(1)
  40. if not fs.exists("LabyOS/Programme") then
  41. fs.delete("LabyOS")
  42. end
  43. -- ########################## -- Terminate Screen -- ############################ --
  44. function terminate()   
  45.  while true do
  46.   local events = os.pullEventRaw()
  47.    if events == "terminate" then
  48. os.reboot()
  49.   end
  50.  end
  51. end
  52. -- ########################## -- Change startup (BACKUP) -- ############################ --
  53. function runDesktop1()
  54.  if fs.exists("startup") then
  55.    fs.makeDir("LabyOS/Backup")
  56.   if fs.exists("LabyOS/Backup/startup") then
  57.    fs.delete("LabyOS/Backup/startup")
  58.   end
  59.    fs.copy("startup", "LabyOS/Backup/startup")
  60.   if fs.exists("LabyOS/Programme/Setup") then
  61.    fs.delete("startup")
  62.    fs.copy("LabyOS/Programme/Setup", "startup")
  63.    os.reboot()
  64.   end
  65.  else
  66.  r("clear")
  67.  error("startup is not exists")
  68.  end
  69. end
  70. -- ########################## -- Run Login Screen -- ############################ --
  71. function LabyOSUpdateLogin1()
  72. function loadscreen1()
  73. image = paintutils.loadImage("LabyOS/Texture/Login")
  74. paintutils.drawImage(image, 1, 1)
  75. -- ## Test Update ## --
  76. sbc(32768)
  77. scp(30,1)
  78. stc(1)
  79. sbc(2048)
  80. stc(16)
  81. w([[:]])
  82. scp(30,2)
  83. p([[:]])
  84. scp(31,1)
  85. r("LabyOS/Config/LabyOSUpdate")
  86. -- ################# --
  87. -- ############ create Accounts ############
  88.         fs.makeDir("LabyOS/Profile")
  89. if not fs.exists("LabyOS/Profile/User1") then
  90.         createAcc1 = fs.open("LabyOS/Profile/User1", "w")
  91.         createAcc1.write("Guest\n")
  92.         createAcc1.write("no password")
  93.         createAcc1.close()
  94. end
  95. if not fs.exists("LabyOS/Profile/User2") then
  96.         createAcc2 = fs.open("LabyOS/Profile/User2", "w")
  97.         createAcc2.write("Free slot\n")
  98.         createAcc2.write("no password")
  99.         createAcc2.close()
  100. end
  101. if not fs.exists("LabyOS/Profile/User3") then
  102.         createAcc3 = fs.open("LabyOS/Profile/User3", "w")
  103.         createAcc3.write("Free slot\n")
  104.         createAcc3.write("no password")
  105.         createAcc3.close()
  106. end
  107. -- ## Run Interface ## --
  108. sbc(2048)
  109. stc(1)
  110. scp(1,1)
  111. w([[CraftOS]])
  112. scp(1,2)
  113. w(version1)
  114. scp(3,9)
  115. sbc(8)
  116. w([[Welcome]])
  117. scp(15,3)
  118. w([[:]])
  119. scp(15,4)
  120. w([[:]])
  121. scp(15,5)
  122. w([[:]])
  123. scp(15,6)
  124. w([[:]])
  125. scp(15,7)
  126. w([[:]])
  127. scp(15,8)
  128. w([[:]])
  129. scp(15,9)
  130. w([[:]])
  131. scp(15,10)
  132. w([[:]])
  133. scp(15,11)
  134. w([[:]])
  135. scp(15,12)
  136. w([[:]])
  137. scp(15,13)
  138. w([[:]])
  139. scp(15,14)
  140. w([[:]])
  141. scp(15,15)
  142. w([[:]])
  143. scp(15,16)
  144. w([[:]])
  145. sbc(2048)
  146. scp(4,18)
  147. w([[Turn off computer]])
  148. sbc(2)
  149. scp(2,18)
  150. w([[Q]])
  151. sbc(256)
  152. -- ## Profil Box ## --
  153. ------------### 1 ####
  154. scp(17,5)
  155. w([[1   ]])
  156. scp(17,6)
  157. w([[    ]])
  158. ------------### 2 ####
  159. scp(17,9)
  160. w([[2   ]])
  161. scp(17,10)
  162. w([[    ]])
  163. ------------### 3 ####
  164. scp(17,13)
  165. w([[3   ]])
  166. scp(17,14)
  167. w([[    ]])
  168. -- ################ --
  169. -- ## Profil Names ## --
  170. ------------### 1 ####
  171. sbc(8)
  172. scp(22,5)
  173. w([[1]])
  174. stc(16384)
  175. scp(22,6)
  176. w([[-#-]])
  177. ------------### 2 ####
  178. stc(1)
  179. sbc(8)
  180. scp(22,9)
  181. w([[2]])
  182. stc(16384)
  183. scp(22,10)
  184. w([[-#-]])
  185. ------------### 3 ####
  186. stc(1)
  187. sbc(8)
  188. scp(22,13)
  189. w([[3]])
  190. stc(16384)
  191. scp(22,14)
  192. w([[-#-]])
  193. -- ################ Print name data ################
  194. logincheck = fs.open("LabyOS/Profile/User1", "r")
  195.          if logincheck then
  196.           username1 = logincheck.readLine()
  197.           userpass1 = logincheck.readLine()
  198.          end
  199.           logincheck.close()
  200.            scp(22,5)
  201.            stc(1)
  202.            w(username1)
  203.            stc(32)
  204.            if userpass1 == "no password" then
  205.            scp(22,6)
  206.            w([[No password]])
  207.            else
  208.            scp(22,6)
  209.            stc(16384)
  210.            w([[Password     ]])
  211.            end
  212.            if username1 == "Free slot" then
  213.             stc(16)
  214.             scp(22,6)
  215.             w([[Unavailable!        ]])
  216.            end
  217. logincheck = fs.open("LabyOS/Profile/User2", "r")
  218.          if logincheck then
  219.           username2 = logincheck.readLine()
  220.           userpass2 = logincheck.readLine()
  221.          end
  222.           logincheck.close()
  223.            scp(22,9)
  224.            stc(1)
  225.            w(username2)
  226.            stc(32)
  227.            if userpass2 == "no password" then
  228.            scp(22,10)
  229.            w([[No password]])
  230.            else
  231.            scp(22,10)
  232.            stc(16384)
  233.            w([[Password     ]])
  234.            end
  235.            if username2 == "Free slot" then
  236.             stc(16)
  237.             scp(22,10)
  238.             w([[Unavailable!        ]])
  239.            end
  240. logincheck = fs.open("LabyOS/Profile/User3", "r")
  241.          if logincheck then
  242.           username3 = logincheck.readLine()
  243.           userpass3 = logincheck.readLine()
  244.          end
  245.           logincheck.close()
  246.            scp(22,13)
  247.            stc(1)
  248.            w(username3)
  249.            stc(32)
  250.            if userpass3 == "no password" then
  251.            scp(22,14)
  252.            w([[No password]])
  253.            else
  254.            stc(16384)
  255.            scp(22,14)
  256.            w([[Password     ]])
  257.            end
  258.            if username3 == "Free slot" then
  259.             stc(16)
  260.             scp(22,14)
  261.             w([[Unavailable!        ]])
  262.            end
  263. -- #################################################
  264. end
  265. loadscreen1()
  266. -- ################### --
  267. -- ##### Mouse click / shutdown / window ##### --
  268. function drag()
  269. breakloop1a = 0
  270. -- ########### Window design off ##############
  271.       X = 25
  272.       Y = 6
  273.       sbc(8)
  274.       scp(X-8,Y)
  275.       sbc(2048)
  276.       stc(1)
  277.       w([[Info            ]])
  278.       sbc(16384)
  279.       w([[X]])
  280.       sbc(256)
  281.       stc(32768)
  282.       scp(X-8,Y+1)
  283.       p([[    Shutdown?    ]])
  284.       scp(X-8,Y+2)
  285.       p([[                 ]])
  286.       scp(X-8,Y+3)
  287.       p([[   [Y]    [N]    ]])
  288.       scp(X-8,Y+4)
  289.       stc(16384)
  290.       p([[                %]])
  291. -- ########################################
  292.  while true do
  293.    function breakloop1()
  294.    breakloop1a = 1
  295.    end
  296.      event, button, X, Y = os.pullEvent("mouse_drag")
  297.      XY = X..","..Y
  298.    if button == 1 and breakloop1a == 0 then
  299. -- ########### Window design on ##############
  300.       loadscreen1()
  301.       scp(X-8,Y)
  302.       sbc(2048)
  303.       stc(1)
  304.       w([[Info            ]])
  305.       sbc(16384)
  306.       w([[X]])
  307.       sbc(256)
  308.       stc(32768)
  309.       scp(X-8,Y+1)
  310.       p([[    Shutdown?    ]])
  311.       scp(X-8,Y+2)
  312.       p([[                 ]])
  313.       scp(X-8,Y+3)
  314.       p([[   [Y]    [N]    ]])
  315.       scp(X-8,Y+4)
  316.       stc(16384)
  317.       p([[                %]])
  318. -- ########################################
  319.    end
  320.    
  321.    if breakloop1a == 1 then
  322.    break
  323.    end
  324.   end
  325.  end
  326. -- ########### Window: Close ##############
  327. function click()
  328. for clicks=0,2 do
  329.    event, button, X2, Y2 = os.pullEvent("mouse_click")
  330.    XY2 = X2..","..Y2
  331. -- ######## Window: No moved function #########
  332.    if XY2 == "33,6" then
  333.      breakloop1()
  334.      para(terminate, LabyOSUpdateLogin1)
  335.     end
  336.    ----------------------
  337.    if XY2 == "28,9" then
  338.      breakloop1()
  339.      para(terminate, LabyOSUpdateLogin1)
  340.    end
  341.    ----------------------
  342.    if XY2 == "21,9" then
  343.      breakloop1()
  344.      loadscreen1()
  345.      s(1)
  346.      sbc(2048)
  347.      scp(1,1)
  348.      w([[                                                   ]])
  349.      scp(1,2)
  350.      s(0,1)
  351.      w([[                                                   ]])
  352.      scp(2,18)
  353.      s(0,1)
  354.      w([[                                                   ]])
  355.      sbc(8)
  356.      s(1)
  357.      r("clear")
  358.      stc(1)
  359.      for shutdown1=0,1 do
  360.         scp(20,9)
  361.         w([[: Shutdown]])
  362.         s(0.1)
  363.         scp(20,9)
  364.         w([[/ Shutdown]])
  365.         s(0.1)
  366.         scp(20,9)
  367.         w([[- Shutdown]])
  368.         s(0.1)
  369.         scp(20,9)
  370.         w([[\ Shutdown]])
  371.         s(0.1)
  372.      end
  373.      os.shutdown()
  374. end
  375. end
  376. -- #####################################
  377.   while true do
  378.      event, button, X, Y = os.pullEvent("mouse_drag")
  379.      XY = X..","..Y
  380.      event, button, X2, Y2 = os.pullEvent("mouse_click")
  381.      XY2 = X2..","..Y2
  382. -- ######## Window: moved function #########
  383.          if XY2 == (X + 8) .. "," .. Y then
  384.           breakloop1()
  385.           para(terminate, LabyOSUpdateLogin1)
  386.           break
  387.          end
  388.          if XY2 == (X + 3) .. "," .. (Y + 3) then
  389.           breakloop1()
  390.           para(terminate, LabyOSUpdateLogin1)
  391.           break
  392.          end
  393.         if XY2 == (X - 4) .. "," .. (Y + 3) then
  394.             breakloop1()
  395.             loadscreen1()
  396.             s(1)
  397.             sbc(2048)
  398.             scp(1,1)
  399.             w([[                                                   ]])
  400.             scp(1,2)
  401.             s(0,1)
  402.             w([[                                                   ]])
  403.             scp(2,18)
  404.             s(0,1)
  405.             w([[                                                   ]])
  406.             sbc(8)
  407.             s(1)
  408.             r("clear")
  409.             stc(1)
  410.                 for shutdown1=0,2 do
  411.                 scp(20,9)
  412.                 w([[: Shutdown]])
  413.                 s(0.1)
  414.                 scp(20,9)
  415.                 w([[/ Shutdown]])
  416.                 s(0.1)
  417.                 scp(20,9)
  418.                 w([[- Shutdown]])
  419.                 s(0.1)
  420.                 scp(20,9)
  421.                 w([[\ Shutdown]])
  422.                 s(0.1)
  423.             end
  424.             os.shutdown()
  425.         end
  426. -- #################################
  427.   end
  428. end
  429. -- ################################
  430. -- ###############################################################
  431. while true do
  432.       function loopbreak2a()
  433.        loopbreak2 = 1
  434.       end
  435.      event, button, X, Y = os.pullEvent("mouse_click")
  436.      XY = X..","..Y
  437. -- ######## Open window point #########
  438.       if XY == "2,18" and button == 1 then
  439.        scp(4,18)
  440.        sbc(2048)
  441.        stc(1)
  442.        write("You can move the window!")
  443.        para(click, drag)
  444.       end
  445. -- ############### select account #################
  446. -- ################# GUEST ###############
  447.       if X >= 17 and X <= 40 and Y == 5 or X >= 17 and X <= 40 and Y == 6 then
  448.        stc(16)
  449.          scp(40,6)
  450.          w([[ <         ]])
  451.          login2 = fs.open("LabyOS/Profile/User1", "r")
  452.          if login2 then
  453.           username1 = login2.readLine()
  454.           userpass1 = login2.readLine()
  455.          end
  456.           login2.close()
  457.            if username1 == "Free slot" then
  458.               para(terminate, LabyOSUpdateLogin1)
  459.            end
  460.            if userpass1 == "no password" then
  461.             loopbreak2a()
  462.             if not fs.exists("LabyOS/Online") then
  463.              fs.makeDir("LabyOS/Online")
  464.             end
  465.               setOnline = fs.open("LabyOS/Online/data", "w")
  466.               setOnline.write(username1)
  467.               setOnline.close()
  468.             runDesktop1()
  469.             else
  470.             sbc(1)
  471.             stc(32768)
  472.             scp(22,6)
  473.             sw([[                  ]])
  474.             scp(22,6)
  475.             passwordcheck1 = read("*")
  476.              if passwordcheck1 == userpass1 then
  477.               loopbreak2a()
  478.             if not fs.exists("LabyOS/Online") then
  479.              fs.makeDir("LabyOS/Online")
  480.             end
  481.               setOnline = fs.open("LabyOS/Online/data", "w")
  482.               setOnline.write(username1)
  483.               setOnline.close()
  484.               runDesktop1()
  485.              else
  486.               stc(16384)
  487.               sbc(8)
  488.               scp(22,6)
  489.               sw([[Wrong password!                ]])
  490.               s(1)
  491.               scp(22,6)
  492.               w([[Passwort            ]])
  493.              end
  494.            end
  495.       end
  496. -- ################# User 2 ###############
  497. if X >= 17 and X <= 40 and Y == 9 or X >= 17 and X <= 40 and Y == 10 then
  498.        stc(16)
  499.          scp(40,10)
  500.          w([[ <         ]])
  501.          login3 = fs.open("LabyOS/Profile/User2", "r")
  502.          if login3 then
  503.           username2 = login3.readLine()
  504.           userpass2 = login3.readLine()
  505.          end
  506.           login3.close()
  507.            if username2 == "Free slot" then
  508.               para(terminate, LabyOSUpdateLogin1)
  509.            end
  510.            if userpass2 == "no password" then
  511.             loopbreak2a()
  512.             if not fs.exists("LabyOS/Online") then
  513.              fs.makeDir("LabyOS/Online")
  514.             end
  515.               setOnline = fs.open("LabyOS/Online/data", "w")
  516.               setOnline.write(username2)
  517.               setOnline.close()
  518.             runDesktop1()
  519.             else
  520.             sbc(1)
  521.             stc(32768)
  522.             scp(22,10)
  523.             sw([[                  ]])
  524.             scp(22,10)
  525.             passwordcheck1 = read("*")
  526.              if passwordcheck1 == userpass2 then
  527.               loopbreak2a()
  528.             if not fs.exists("LabyOS/Online") then
  529.              fs.makeDir("LabyOS/Online")
  530.             end
  531.               setOnline = fs.open("LabyOS/Online/data", "w")
  532.               setOnline.write(username2)
  533.               setOnline.close()
  534.               runDesktop1()
  535.              else
  536.               stc(16384)
  537.               sbc(8)
  538.               scp(22,10)
  539.               sw([[Wrong password!                ]])
  540.               s(1)
  541.               scp(22,10)
  542.               w([[Password            ]])
  543.              end
  544.            end
  545.       end
  546. -- ################# User 3 ###############
  547. if X >= 17 and X <= 40 and Y == 13 or X >= 17 and X <= 40 and Y == 14 then
  548.        stc(16)
  549.          scp(40,14)
  550.          w([[ <         ]])
  551.          login4 = fs.open("LabyOS/Profile/User3", "r")
  552.          if login4 then
  553.           username3 = login4.readLine()
  554.           userpass3 = login4.readLine()
  555.          end
  556.           login4.close()
  557.            if username3 == "Free slot" then
  558.               para(terminate, LabyOSUpdateLogin1)
  559.            end
  560.            if userpass3 == "no password" then
  561.             loopbreak2a()
  562.             if not fs.exists("LabyOS/Online") then
  563.              fs.makeDir("LabyOS/Online")
  564.             end
  565.               setOnline = fs.open("LabyOS/Online/data", "w")
  566.               setOnline.write(username3)
  567.               setOnline.close()
  568.             runDesktop1()
  569.              else
  570.             sbc(1)
  571.             stc(32768)
  572.             scp(22,14)
  573.             sw([[                  ]])
  574.             scp(22,14)
  575.             passwordcheck1 = read("*")
  576.              if passwordcheck1 == userpass3 then
  577.               loopbreak2a()
  578.             if not fs.exists("LabyOS/Online") then
  579.              fs.makeDir("LabyOS/Online")
  580.             end
  581.               setOnline = fs.open("LabyOS/Online/data", "w")
  582.               setOnline.write(username3)
  583.               setOnline.close()
  584.               runDesktop1()
  585.              else
  586.               stc(16384)
  587.               sbc(8)
  588.               scp(22,14)
  589.               sw([[Wrong password!                ]])
  590.               s(1)
  591.               scp(22,14)
  592.               w([[Password            ]])
  593.              end
  594.            end
  595.       end
  596. -- ###############################################
  597.    if loopbreak2 == 1 then
  598.    break
  599.    end
  600. end
  601. end
  602. -- ######################################################### --
  603. if fs.exists("LabyOS/Config/SaveStart") then
  604. saveS = fs.open("LabyOS/Config/SaveStart", "r")
  605. SaveStart = saveS.readLine()
  606. saveS.close()
  607. else
  608. fs.makeDir("LabyOS/Config/")
  609. saveS = fs.open("LabyOS/Config/SaveStart", "w")
  610. saveS.write("false")
  611. saveS.close()
  612. end
  613.  
  614.  
  615. if SaveStart == "true" then
  616. saveS = fs.open("LabyOS/Config/SaveStart", "w")
  617. saveS.write("false")
  618. saveS.close()
  619. para(terminate, LabyOSUpdateLogin1) -- DEVELOPER                                                                   ######## FAST START #########
  620. elseif SaveStart == "trueKeep" then
  621. para(terminate, LabyOSUpdateLogin1)
  622. end
  623. -- ########################## -- Start Information -- ############################ --
  624. -- ## Color Test ## --
  625. r("clear")
  626. stc(1)
  627. p([[CraftOS 6.0]])
  628. if term.isColor() then
  629. elseif not term.isColor() then
  630. scp(13,1)
  631. stc(1)
  632. w([[    :ERROR:CraftOS can't start.      ]])
  633. scp(13,2)
  634. p([[    :      Computer is incompatible  ]])
  635. scp(13,3)
  636. p([[    +----------------------------------]])
  637. scp(1,2)
  638. w([[> ]])
  639. while true do
  640. inputerror1 = read()
  641. r(inputerror1)
  642. w([[> ]])
  643. end
  644. end
  645. -- ################# --
  646. -- ## HTTP Test ## --
  647. r("clear")
  648. stc(1)
  649. print(os.version())
  650. if http then
  651. elseif not http then
  652. scp(13,1)
  653. stc(1)
  654. w([[    :ERROR:CraftOS can't start.      ]])
  655. scp(13,2)
  656. p([[    :      HTTP is not enabled.     ]])
  657. scp(13,3)
  658. p([[    +----------------------------------]])
  659. scp(1,2)
  660. w([[> ]])
  661. while true do
  662. inputerror1 = read()
  663. r(inputerror1)
  664. w([[> ]])
  665. end
  666. end
  667. -- ############### --
  668. -- ## Start Animation ## ---------------------------------------> START <--------------------------
  669. if fs.exists("LabyOS/Config/LabyOSUpdate") then
  670. fs.delete("LabyOS/Config/LabyOSUpdate")
  671. end
  672. -- ###################### --
  673. -- ## TabJump 1 ## --
  674. function tabjump2()
  675.         local sEvent, param = os.pullEvent("key")
  676.         if sEvent == "key" then
  677.             r("clear")
  678.             scp(1,19)
  679.             w([[Skip..]])
  680.         end
  681.     end
  682. -- ############### --
  683. -- ## TabJump 2 ## --
  684. function tabjump1()
  685. term.setTextColour(colours.yellow)
  686. term.clear()
  687. term.setCursorPos(1, 1)
  688. print ("Computer ID: "..ID)
  689. term.setCursorPos(1, 8)
  690. print ("---------------------------------------------------")
  691. print ("           CraftOS 6.3.1 by CraftCo 2014         ")
  692. print ("---------------------------------------------------")
  693. sleep(4)
  694. term.setCursorPos(16, 20)
  695. -- ########################## -- Ladebalken 1 -- ############################ --
  696. stc(2)
  697. for loadup1=1,5 do
  698. loadup1=loadup1*20
  699. scp(24,16)
  700. w(loadup1)
  701. w([[%]])
  702. scp(27,16)
  703. w([[ ]])
  704. s(0.1)
  705. scp(20,17)
  706. w([[... ooo ...]])
  707. s(0.1)
  708. scp(20,17)
  709. w([[ .. Ooo .. ]])
  710. s(0.1)
  711. scp(20,17)
  712. w([[  . oOo .  ]])
  713. s(0.1)
  714. scp(20,17)
  715. w([[    ooO    ]])
  716. s(0.1)
  717. scp(22,17)
  718. w([[. ooo .]])
  719. s(0.1)
  720. scp(21,17)
  721. w([[.. ooo ..]])
  722. s(0.1)
  723. scp(20,17)
  724. w([[... ooo ...]])
  725. s(0.1)
  726. end
  727. term.setBackgroundColour(colours.black)
  728. r("clear")
  729. -- ############################################################################# --
  730. end
  731. function tabjumpshell()
  732. parallel.waitForAny(tabjump1, tabjump2)
  733. end
  734. tabjumpshell()
  735. -- ############### --
  736. function UpdaterL()
  737.  
  738.  
  739. fs.makeDir("LabyOS/Texture")
  740.     r("pastebin get QgZeJxkS LabyOS/Texture/Documents")
  741.     r("pastebin get U9TijTVq LabyOS/Texture/Login")
  742. fs.makeDir("LabyOS/Texture/Desktop")
  743.     r("pastebin get 9EvMFZbV LabyOS/Texture/Desktop/1")
  744.     r("pastebin get 007MQDJ6 LabyOS/Texture/Desktop/2")
  745.  
  746. -- ######################### -- Download Programme -- ############################ ---------------------------------#ADD Programme#--------------
  747. if not fs.exists("LabyOS/Config/TimeAPI") then
  748. TimeAPI = fs.open("LabyOS/Config/TimeAPI", "w")
  749. TimeAPI.write("EN")
  750. TimeAPI.close()
  751. end
  752.  
  753. fs.makeDir("LabyOS/Programme/")
  754. fs.makeDir("LabyOS/Texture/bin")
  755. fs.makeDir("LabyOS/Documents/admin/labystudio/apps")
  756.  
  757. r("delete startup")
  758. r("delete LabyOS/Programme/Shutdown")
  759. r("delete LabyOS/Programme/Setup")
  760. r("delete LabyOS/Programme/Run")
  761. r("delete LabyOS/Programme/Relog")
  762. r("delete LabyOS/Programme/Reboot")
  763. r("delete LabyOS/Programme/Desktop")
  764. r("delete LabyOS/Programme/Terminal")
  765. r("delete LabyOS/Programme/Manager")
  766. r("delete LabyOS/Programme/Documents")
  767. r("delete LabyOS/Programme/Browser")
  768. r("delete LabyOS/Programme/System")
  769. r("delete LabyOS/Programme/Shutdown")
  770. r("delete LabyOS/Programme/Settings")
  771. r("delete LabyOS/Programme/Paint")
  772. r("delete LabyOS/Programme/Editor")
  773. r("delete LabyOS/Texture/bin/Folder")
  774. r("delete LabyOS/Documents/admin/labystudio/apps/Skype")
  775.  
  776. r("pastebin get eVph1zkH startup")
  777. r("pastebin get AyKYQzA8 LabyOS/Programme/Shutdown")
  778. r("pastebin get qPumvzFP LabyOS/Programme/Setup")
  779. r("pastebin get NYJ8Ccvi LabyOS/Programme/Run")
  780. r("pastebin get kr0MY3t7 LabyOS/Programme/Relog")
  781. r("pastebin get pGwVjzQC LabyOS/Programme/Reboot")
  782. r("pastebin get gpwSk1e2 LabyOS/Programme/Desktop")
  783. r("pastebin get Vi6Z9X5k LabyOS/Programme/Terminal")
  784. r("pastebin get GPEMdx1q LabyOS/Programme/Manager")
  785. r("pastebin get SJBQ2vhW LabyOS/Programme/Documents")
  786. r("pastebin get Y9kdU79Y LabyOS/Programme/Browser")
  787. r("pastebin get VRUmKTTY LabyOS/Programme/System")
  788. r("pastebin get CcdCv5wa LabyOS/Programme/Settings")
  789. r("pastebin get aL3UtyWV LabyOS/Programme/Paint")
  790. r("pastebin get myAdtvXj LabyOS/Programme/Editor")
  791. r("pastebin get JE3Ve34F LabyOS/Texture/bin/Task")
  792. r("pastebin get Znakc8nq LabyOS/Texture/bin/File")
  793. r("pastebin get Ped1KULT LabyOS/Texture/bin/Folder")
  794. -- apps
  795. r("pastebin get D9DefNaP LabyOS/Documents/admin/labystudio/apps/Skype")
  796.  
  797. os.reboot()
  798. end
  799. -- ########################## -- Get FULL -- ############################ --
  800. function fullV2()
  801. scp(-90,10)
  802. stc(1)
  803. if http then
  804. if fs.exists("LabyOS/Config/LabyOSUpdate") then
  805. fs.delete("LabyOS/Config/LabyOSUpdate")
  806. end
  807. end
  808. -- ########################## -- Download Design -- ############################ --
  809. fs.makeDir("LabyOS/Config")
  810.     r("pastebin get gffqXK2c LabyOS/Config/LabyOSUpdate")
  811.    
  812.    
  813. if not fs.exists("LabyOS/Config/OSversion") then
  814. version = fs.open("LabyOS/Config/OSversion", "w")
  815. version.write(OfficialVersion)
  816. version.close()
  817. end
  818. if not fs.exists("LabyOS/Programme") then
  819. UpdaterL()
  820. end
  821. -- ######################### -- Load select -- ############################
  822. r("clear")
  823. para(terminate, LabyOSUpdateLogin1)
  824. end
  825. function fullV1()
  826. for loadup2=1,2 do
  827. loadup2=loadup2*45
  828. scp(24,16)
  829. w(loadup2)
  830. w([[%]])
  831. scp(27,16)
  832. w([[ ]])
  833. s(0.1)
  834. scp(20,17)
  835. w([[... ooo ...]])
  836. s(0.1)
  837. scp(20,17)
  838. w([[ .. Ooo .. ]])
  839. s(0.1)
  840. scp(20,17)
  841. w([[  . oOo .  ]])
  842. s(0.1)
  843. scp(20,17)
  844. w([[    ooO    ]])
  845. s(0.1)
  846. scp(22,17)
  847. w([[. ooo .]])
  848. s(0.1)
  849. scp(21,17)
  850. w([[.. ooo ..]])
  851. s(0.1)
  852. scp(20,17)
  853. w([[... ooo ...]])
  854. s(0.1)
  855. end
  856. end
  857. function fullV()
  858. parallel.waitForAny(fullV1(), fullV2())
  859. end
  860. -- ######################################################################### --
  861. -- ########################## -- Start auswahl -- ############################ --
  862. function Systemstart1()
  863. systemadd2 = {}
  864. systemadd1 = 1
  865. -- ## Optionen ## --
  866. term.setTextColour(colours.yellow)
  867. systemadd2[1] = "Open to Desktop"
  868. systemadd2[2] = "Open Notification Centre"
  869. systemadd2[3] = "Open Terminal     "
  870. systemadd2[4] = "Open Control Centre"
  871. -- ############## --
  872. function run1(numer)
  873.  if numer == 1 then
  874. -- ## Option 1 ## --
  875. fullV()
  876. -- ################ --  
  877. end
  878.  if numer == 2 then
  879. -- ## Option 2 ## --
  880. term.clear()
  881. term.setCursorPos(1, 1)
  882. print ("Loading Terminal")
  883. sleep(1)
  884. shell.run("CraftOS/Terminal/Login")
  885. shell.run("NC")
  886. -- ################ --  
  887.  end
  888.   if numer == 3 then
  889. -- ## Option 3 ## --
  890. r("clear")
  891. sleep(0.2)
  892.  if fs.exists("CraftOS/Terminal/Boot1") == true then
  893.   shell.run("CraftOS/Terminal/Boot1")
  894.  else
  895.  end
  896. shell.run("CraftOS/Terminal/Login")
  897. shell.run("CraftOS/8Loader")
  898. term.setTextColour(colours.yellow)
  899. print ("CraftOS "..version1.." Terminal")
  900. write ("Total storage space: ")
  901. shell.run("drive")
  902. sleep(0.2)
  903. -- ################ --  
  904.  end
  905.   if numer == 4 then
  906. -- ## Option 4 ## --
  907. term.clear()
  908. term.setCursorPos(1, 1)
  909. print ("Loading Terminal")
  910. sleep(1)
  911. shell.run("CraftOS/Terminal/Login")
  912. shell.run("CC")
  913. -- ################ --  
  914.  end
  915. end
  916. function Taste()
  917.  sleep(0)
  918.  event, argument = os.pullEvent()
  919.  if event == "key" then
  920.   if argument == 28 then
  921.    return run1(systemadd1)
  922.   elseif argument == 200 then
  923.    if systemadd1 == 1 then
  924.    else
  925.     systemadd1 = systemadd1 - 1
  926.    end
  927.   elseif argument == 208 then
  928.    if systemadd1 == table.getn(systemadd2) then
  929.    else
  930.     systemadd1 = systemadd1 + 1
  931.    end
  932.   else
  933.    return Taste()
  934.   end
  935.  else
  936.   return Taste()
  937.  end
  938.  return menu()
  939. end
  940. function menu()
  941. -- ## Option-Design ## --
  942. r("clear")
  943. stc(16)
  944. p("Boot options - CraftOS "..version1)
  945. stc(1)
  946. p([[---------------------------------------------------]])
  947. -- ################ --  
  948.  for i=1, table.getn(systemadd2) do
  949.   if systemadd1 == i then
  950. -- ## Option-Pfeil ## --
  951.    print("> "..systemadd2[i].."")
  952.   else
  953.    print("  "..systemadd2[i].."")
  954. -- ################ --  
  955.   end
  956.  end
  957.  return Taste()
  958. end
  959. shell.run("clear")
  960. return menu()
  961. end
  962. -- ## RUN ## --
  963. Systemstart1()
  964. -- ######### --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement