Advertisement
COOLGAMETUBEorginal

[ComputerCraft] Wicows Startup 2.0

Jul 3rd, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.33 KB | None | 0 0
  1. -- MODIFY AREA
  2.  
  3. -- BEGIN NO MODIFY! && END MODIFY AREA --
  4. --License:
  5. -- ©opyright COOLGAMETUBE 2015 - 2200
  6. -- REUPLOAD ONLY BY INCLUDING IN YOUR PROJECT!
  7. -- REUPLOAD ONLY WITH NO MODIFICATION IN "NO MODIFY" AREA
  8. -- REUPLOAD ONLY WITH COOLGAMETUBE COPYRIGHT MARKER (IN THIS FILE)
  9. -- CREDIT ME IN YOUR CREDITS (Wicows Startup - COOLGAMETUBE)
  10. -- You are able to modify and reupload this Programm (BUT NOT IN MODIFY AREA) if respecting the points
  11. ---------------------
  12. -- Additional Software:
  13. --- Wicows Alias Manager: Cooming Soon!
  14. --- FileType Manager: Cooming Soon!
  15. ---------------------
  16. local helpDir = "1"
  17. print("Preparing! Please wait...")
  18. term.setCursorBlink(true)
  19. if fs.exists("/system32/cfg/helpDir.cfg") then
  20.     local f1 = fs.open("/system32/cfg/helpDir.cfg", "r")
  21.     helpDir = f1.readAll()
  22.     f1.close()
  23. else
  24.     write("Creating Config")
  25.     local f4 = fs.open("/system32/cfg/helpDir.cfg", "w")
  26.     f4.write("/system32/help")
  27.     f4.close()
  28.     helpDir = "/system32/help/"
  29.     os.reboot()
  30. end
  31. if fs.isDir(helpDir) then
  32.     if fs.exists(helpDir.."startup") then
  33.         fs.delete(helpDir.."startup")
  34.     end
  35.     local helpText = "startup (Wicows Startup) is a booting program, that setting up your System"
  36.     local helpFile = fs.open(helpDir.."startup","w")
  37.     helpFile.write(helpText)
  38.     helpFile.close()
  39. else
  40.     fs.makeDir(helpDir)
  41. end
  42.  
  43. for _, hlpFile in ipairs(fs.list("/rom/help/")) do
  44.     if not fs.exists(helpDir.."/"..hlpFile) then
  45.         write(",-------,\n|Install|\n'-------'\n\nCopying "..hlpFile.."\n")
  46.         fs.copy("/rom/help/"..hlpFile, helpDir.."/"..hlpFile)
  47.         shell.run("clear")
  48.     end
  49. end
  50.  
  51. help.setPath(helpDir)
  52. term.setCursorBlink(false)
  53. shell.run("clear")
  54. print(",------------------,")
  55. print("|Wicows Startup 2.0|")
  56. print("'------------------'")
  57. print("Starting RedNet...")
  58. for i,p in ipairs(peripheral.getNames()) do
  59.     sleep(0)
  60.     if peripheral.getType(p) == "modem" then
  61.         rednet.open(p)
  62.     end
  63. end
  64. sleep(0)
  65. print("Loading API's!")
  66.  
  67. sleep(0.5)
  68. function l(file)
  69.     os.loadAPI(file)
  70.     print("API "..file.." loaded!")
  71.  
  72.  
  73.     sleep(0.1)
  74. end
  75.  
  76. function s(p)
  77.     if fs.isDir(p.."/apis") then
  78.         for _, file in ipairs(fs.list(p.."/apis")) do
  79.             l(file)
  80.         end
  81.     end
  82.  
  83.     if fs.isDir(p.."/api") then
  84.         for _, file in ipairs(fs.list(p.."/api")) do
  85.             l(file)
  86.         end
  87.     end
  88.  
  89.     if fs.isDir(p.."/APIS") then
  90.         for _, file in ipairs(fs.list(p.."/APIS")) do
  91.             l(file)
  92.         end
  93.     end
  94.  
  95.     if fs.isDir(p.."/API") then
  96.         for _, file in ipairs(fs.list(p.."/API")) do
  97.             l(file)
  98.         end
  99.     end
  100.  
  101.     if fs.isDir(p.."/APIs") then
  102.         for _, file in ipairs(fs.list(p.."/APIs")) do
  103.              l(file)
  104.         end
  105.     end
  106.  
  107.     if fs.isDir(p.."/Apis") then
  108.         for _, file in ipairs(fs.list(p.."/Apis")) do
  109.              l(file)
  110.         end
  111.     end
  112.  
  113.     if fs.isDir(p.."/Api") then
  114.         for _, file in ipairs(fs.list(p.."/Api")) do
  115.              l(file)
  116.         end
  117.     end
  118. end
  119.  
  120. s("") -- Searching in main Folder
  121. s(".") --Searching in current Folder
  122. s("/os") -- Searching in os folder
  123. s("/OS") -- Searching in OS folder
  124. s("/Os") -- Searching in Os folder
  125.  
  126. shell.run("clear")
  127.  
  128. if fs.exists("autorun.cfg") then
  129.     local f5 = fs.open("autorun.cfg", "r")
  130.     local autorun = f5.readAll()
  131.     f5.close()
  132.     shell.run(autorun)
  133. else
  134.     if term.isColor() then
  135.     term.setTextColor(colors.yellow)
  136.     end
  137.     print(os.version())
  138.     if term.isColor() then
  139.         term.setTextColor(colors.white)
  140.     end
  141. end
  142. -- END NO MODIFY! --
  143.  
  144. -- MODIFY AREA!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement