Advertisement
Derek1017

OS

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