Advertisement
100xdonaldx001

MaxxOS v 3.5.2

May 9th, 2014
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. //pastebin get w1RtfqFd market//
  2. //market get gjdhi6 setup y//
  3. //setup//
  4.  
  5. w,h = term.getSize()
  6. local GUIsCode = "gjdhi8"
  7. local OSCode = "gjdhi7"
  8. local UCode = "gjdhi9"
  9. local key = ""
  10. local UpCode = "gjdhj5"
  11. local CoCode = "gjdhlk"
  12. local aUCode = "gjdhlm"
  13.  
  14. function sClear(x,y)
  15. term.clear()
  16. term.setCursorPos(x,y)
  17. end
  18.  
  19. function cLine(y)
  20. term.setCursorPos(1,y)
  21. term.clearLine()
  22. end
  23.  
  24. function cPos(x,y)
  25. term.setCursorPos(x,y)
  26. end
  27.  
  28. function printCentered(str, ypos)
  29. term.setCursorPos(w/2 - #str/2, ypos)
  30. term.write(str)
  31. term.setCursorPos(1,ypos+1)
  32. end
  33.  
  34. function printRight(str, ypos)
  35. term.setCursorPos(w - #str, ypos)
  36. term.write(str)
  37. term.setCursorPos(1,ypos+1)
  38. end
  39.  
  40. function mainLogo()
  41. term.setBackgroundColor(colors.white)
  42. term.setTextColor(colors.red)
  43. sClear(1,1)
  44. local mainLogo = {
  45. [[ __ __ ]],
  46. [[ / \ / \ ]],
  47. [[ / \/ \ _______ __ ____ __ ]],
  48. [[ / /\ /\ \ | ___ | \ \ / /\ \ / / ]],
  49. [[ / / \__/ \ \ | | | | \ \/ / \ \/ / ]],
  50. [[ / / \ \ | |___| |_ / /\ \ / /\ \ ]],
  51. [[ /__/ \__\|_________| /_/ \_\/_/ \_\ ]],
  52. [[ __________ _______ ]],
  53. [[ _______________ | ______ | | _____| ]],
  54. [[ | | | | | | | |_____ ]],
  55. [[ | SETUP | | | | | |_____ | ]],
  56. [[ |_______________| | |______| | _____| | ]],
  57. [[ |__________| |_______| ]],
  58. [[ by: Marreman ]],
  59. [[ ]],
  60. }
  61.  
  62. for i = 1, 15 do
  63. print(mainLogo[i])
  64. end
  65. term.setBackgroundColor(colors.black)
  66. term.setTextColor(colors.white)
  67. end
  68.  
  69. function main1()
  70. term.setBackgroundColor(colors.blue)
  71. term.setTextColor(colors.black)
  72. sClear(1,1)
  73. term.setBackgroundColor(colors.lightBlue)
  74. cLine(1)
  75. cLine(2)
  76. cLine(3)
  77. printCentered(string.rep("-", w), 1)
  78. printCentered("Wealcome to the setup of MaxxOS", 2)
  79. printCentered(string.rep("-", w), 3)
  80. term.setBackgroundColor(colors.blue)
  81. cPos(1,5)
  82. print("MaxxOS is a Operative System for Computercraft and it is like Windows XP in many ways, so if you like Windows, i think you will like MaxxOS!")
  83. printRight("//Marreman", 8)
  84. cPos(1,h-4)
  85. print("If you got a startup file, it will be renamed to startup2")
  86. printRight("Press 'INSTALL' to continue", h-2)
  87. printCentered(string.rep("-", w), h-3)
  88. printRight("[INSTALL]",h-1)
  89. end
  90.  
  91.  
  92.  
  93.  
  94.  
  95. function startupCreate()
  96. if shell.dir("startup") then
  97. shell.run("rename startup startup2")
  98. else
  99. print("No startup file found.")
  100. end
  101. print("Creating startup file..")
  102. sfile = io.open("/startup", "w")
  103. sfile:write('shell.run("MaxxOS/MaxxOS")')
  104. sfile:close()
  105. end
  106.  
  107. function install()
  108. sClear(1,1)
  109. print("Downloading market for www.turtlescripts.com")
  110. shell.run("pastebin get w1RtfqFd market")
  111. fs.makeDir("MaxxOS")
  112. print("Downloading MaxxOS. Please wait...")
  113. shell.run("market get "..GUIsCode.." MaxxOS/GUIs "..key.." [y]")
  114. shell.run("market get "..OSCode.." MaxxOS/MaxxOS "..key.." [y]")
  115. shell.run("market get "..UCode.." MaxxOS/Uninstall "..key.." [y]")
  116. shell.run("market get "..UpCode.." MaxxOS/Update "..key.." [y]")
  117. shell.run("market get "..CoCode.." MaxxOS/Command "..key.." [y]")
  118. shell.run("market get "..aUCode.." MaxxOS/autoUpdate "..key.." [y]")
  119. print("Download complete!")
  120. print("Creating startup file...")
  121. print("If you got a startup file, it will be renamed to startup2")
  122. startupCreate()
  123. print("Successfully created startup file!")
  124. print("Everything looks normal.")
  125. print("Press 'ENTER' on youre keyboard to run MaxxOS.")
  126. while true do
  127. event, scancode = os.pullEvent("key")
  128. if scancode == 28 then
  129. os.reboot()
  130. end
  131. end
  132. end
  133.  
  134.  
  135. mainLogo()
  136. sleep(3)
  137. main1()
  138. while true do
  139. event, button, xPos, yPos = os.pullEvent("mouse_click")
  140. if xPos >41 and xPos <52 and yPos == 18 then
  141. term.setBackgroundColor(colors.blue)
  142. install()
  143. end
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement