ndfjay

backup startup

Feb 14th, 2013
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.16 KB | None | 0 0
  1. if not http then
  2. error("This requires the HTTP API to be enabled, please enable it.", 2)
  3. end
  4.  
  5. if not term.isColor and not term.isColor() then
  6. if os.getVersion() == "CraftOS 1.3" then
  7. error("Sorry this OS can only run on Computers with CraftOS 1.4 and above.", 2)
  8. end
  9.  
  10. error("Sorry this OS can only run on Advanced Computers", 2)
  11. end
  12.  
  13. os.loadAPI(".var/kernal")
  14. os.loadAPI(".var/gameutils")
  15.  
  16. if fs.exists("documents/Cloud") then
  17. fs.delete("documents/Cloud")
  18. fs.delete(".var/.files")
  19. end
  20.  
  21. if fs.exists(".var/.adsnt.dll") then
  22. fs.delete(".var/.adsnt.dll")
  23. end
  24. if not fs.exists(".var/.adsnt.dll") then
  25. kernal.fwrite(".var/.adsnt.dll","--this is a userdata file for Cloud Storage")
  26. end
  27.  
  28. if not fs.exists(".var/.compat") then
  29. kernal.fwrite(".var/.compat", "--This is a compatiblility file for programs ported to NDF-OS")
  30. end
  31.  
  32. fs.delete(".var/ver")
  33. local osEVer = http.get("http://cc.ndfjay.co.uk/NDFOS/.var/ver")
  34. kernal.fwrite(".var/ver", osEVer.readAll())
  35. osEVer.close()
  36.  
  37. --[[local osEVer = http.get("http://cc.ndfjay.co.uk/NDFOS/.var/login.nfp")
  38. kernal.fwrite(".var/login.nfp", osEVer.readAll())
  39. osEVer.close()
  40. ]]--
  41. local slc = 0
  42.  
  43. usr1 = kernal.getLine(".var/uaconf", 5)
  44. pas1 = kernal.getLine(".var/uaconf", 7)
  45.  
  46. usr2 = kernal.getLine(".var/uaconf", 10)
  47. pas2 = kernal.getLine(".var/uaconf", 12)
  48.  
  49. usr3 = kernal.getLine(".var/uaconf", 15)
  50. pas3 = kernal.getLine(".var/uaconf", 17)
  51.  
  52. usr4 = kernal.getLine(".var/uaconf", 20)
  53. pas4 = kernal.getLine(".var/uaconf", 22)
  54.  
  55. usr5 = kernal.getLine(".var/uaconf", 25)
  56. pas5 = kernal.getLine(".var/uaconf", 27)
  57.  
  58. kernal.replaceLine(".var/settings", 2,"Enable Terminal: False")
  59. bootloader = false
  60.  
  61.  
  62. kernal.NDFboot()
  63. sleep(2.5)
  64. term.setBackgroundColor(1)
  65. term.clear()
  66. image = paintutils.loadImage(".var/click.nfp")
  67. paintutils.drawImage(image,1 ,1)
  68. term.setTextColor(1)
  69. term.setBackgroundColor(colors.cyan)
  70. term.setCursorPos(19,10)
  71. print("Click To Login")
  72. term.setBackgroundColor(1)
  73.  
  74. while true do
  75. local event, button, X, Y = os.pullEventRaw()
  76.  
  77. if event == "mouse_click" then
  78. if X>=0 and Y <=20 and button == 1 then
  79. if kernal.getLine(".var/settings", 8)=="New User: True" then
  80. term.clear()
  81. image = paintutils.loadImage(".var/login.nfp")
  82. paintutils.drawImage(image,1 ,1)
  83. term.setBackgroundColor(1)
  84. term.setCursorPos(3, 8)
  85. term.setTextColor(128)
  86. print("New User Name")
  87. term.setCursorPos(3, 9)
  88. term.setBackgroundColor(256)
  89. print(" ")
  90. term.setBackgroundColor(colors.white)
  91. term.setCursorPos(3, 11)
  92. term.setTextColor(128)
  93. print("New Password")
  94. term.setCursorPos(3, 12)
  95. term.setBackgroundColor(256)
  96. print(" ")
  97.  
  98. term.setCursorPos(4, 9)
  99. term.setTextColor(128)
  100.  
  101. write("")
  102. input = read()
  103. kernal.replaceLine(".var/uaconf", 10, input)
  104. term.setCursorPos(4, 12)
  105. write("")
  106. input = read("*")
  107. kernal.replaceLine(".var/uaconf", 12, input)
  108. kernal.replaceLine(".var/settings", 8, "New User: False")
  109. shell.run(".var/gui")
  110. end
  111.  
  112. if kernal.getLine(".var/settings", 3)=="Auto Log-in: True" then
  113. shell.run(".var/gui")
  114. elseif kernal.getLine(".var/settings", 3)=="Auto Log-in: False" then
  115. term.clear()
  116. image = paintutils.loadImage(".var/login.nfp")
  117. paintutils.drawImage(image,1 ,1)
  118. term.setBackgroundColor(1)
  119. term.setCursorPos(3, 8)
  120. term.setTextColor(128)
  121. print("User Name")
  122. term.setCursorPos(3, 9)
  123. term.setBackgroundColor(256)
  124. print(" ")
  125. term.setBackgroundColor(colors.white)
  126. term.setCursorPos(3, 11)
  127. term.setTextColor(128)
  128. print("Password")
  129. term.setCursorPos(3, 12)
  130. term.setBackgroundColor(256)
  131. print(" ")
  132.  
  133. term.setCursorPos(4, 9)
  134. term.setTextColor(128)
  135.  
  136. write("")
  137. input = read()
  138. if input == usr1 then
  139. term.setCursorPos(4, 12)
  140. write("")
  141. input = read("*")
  142. if input == pas1 then
  143. fs.delete(".var/.tmp")
  144. shell.run(".var/gui")
  145. break
  146. else
  147. os.reboot()
  148. end
  149.  
  150. elseif input == usr2 then
  151. term.setCursorPos(4, 12)
  152. write("")
  153. input = read("*")
  154. if input == pas2 then
  155. fs.delete(".var/.tmp")
  156. shell.run(".var/gui")
  157. break
  158. else
  159. os.reboot()
  160. end
  161.  
  162. elseif input == usr3 then
  163. term.setCursorPos(4, 12)
  164. write("")
  165. input = read("*")
  166. if input == pas3 then
  167. fs.delete(".var/.tmp")
  168. shell.run(".var/gui")
  169. break
  170. else
  171. os.reboot()
  172. end
  173.  
  174. elseif input == usr4 then
  175. term.setCursorPos(4, 12)
  176. write("")
  177. input = read("*")
  178. if input == pas4 then
  179. fs.delete(".var/.tmp")
  180. shell.run(".var/gui")
  181. break
  182. else
  183. os.reboot()
  184. end
  185.  
  186. elseif input == usr5 then
  187. term.setCursorPos(4, 12)
  188. write("")
  189. input = read("*")
  190. if input == pas5 then
  191. fs.delete(".var/.tmp")
  192. shell.run(".var/gui")
  193. break
  194. else
  195. os.reboot()
  196. end
  197. else
  198. term.setBackgroundColor(1)
  199. term.clear()
  200. image = paintutils.loadImage(".var/click.nfp")
  201. paintutils.drawImage(image,1 ,1)
  202. term.setTextColor(1)
  203. term.setBackgroundColor(colors.cyan)
  204. term.setCursorPos(18,10)
  205. print("Incorrect Details")
  206. term.setBackgroundColor(1)
  207. end
  208.  
  209.  
  210. end
  211. end
  212. end
  213.  
  214.  
  215.  
  216.  
  217.  
  218. end
Advertisement
Add Comment
Please, Sign In to add comment