Advertisement
AquaJD

[AUT] Startup

May 3rd, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.72 KB | None | 0 0
  1. --[[
  2.  
  3.     Autos
  4.     Official Startup File
  5.  
  6.     Autos is a copyrighted program. Any modified version of
  7.     Autos submitted onto the internet under a different name
  8.     or author are not permitted.
  9.     That said, you may ask for permission to upload an add-on,
  10.     or application that you would recommend onto the comments
  11.     section of the forum post of Autos.
  12.  
  13. ]]--
  14.  
  15. os.pullEvent = os.pullEventRaw
  16.  
  17. -- Loading the APIs
  18. os.loadAPI("System/.osfiles/resources/APIs/autos")
  19. os.loadAPI("System/.osfiles/resources/APIs/settings")
  20.  
  21. -- The config classes
  22. cfgClasses = {
  23.     "Colors",
  24.     "Applications",
  25.     "OSSettings",
  26.     "Images",
  27.     "Icons"
  28. }
  29.  
  30. -- The OSInfo Box
  31. box_osinfo = {
  32.     x = 3,
  33.     y = 2,
  34.     w = 23,
  35.     h = 10,
  36.     t = "TERMINAL INFO"
  37. }
  38.  
  39. -- The OSPic Box
  40. box_ospic = {
  41.     x = 30,
  42.     y = 3,
  43.     w = 18,
  44.     h = 15,
  45.     t = ""
  46. }
  47.  
  48. -- Current version
  49. osVersion = "0.01"
  50. -- Config File Path
  51. fs_config = "System/.osfiles/.cfg"
  52. -- Desktop File Path
  53. fs_desktop = "System/.osfiles/osparts/desktop"
  54. -- Width and Height of Term
  55. w,h = term.getSize()
  56. -- Loading Background Image
  57. bg_mainSplash = paintutils.loadImage("System/.osfiles/resources/IMGs/fileSplash.img")
  58.  
  59. -- Checking if this computer has the config file
  60. if not fs.exists(fs_config) then
  61.     firstTime = true
  62.     for i=1,#cfgClasses do
  63.         autos.fileWriteTo(fs_config,"["..cfgClasses[i].."]".."\n")
  64.     end
  65.     loadedCFG = settings.openSettingsFile(fs_config)
  66.     loadedCFG.setSectionedValue("Colors","col_mainback","8")
  67.     loadedCFG.setSectionedValue("Colors","col_maintext","1")
  68.     loadedCFG.setSectionedValue("Colors","col_butnback","2048")
  69.     loadedCFG.setSectionedValue("Colors","col_butntitl","8")
  70.     loadedCFG.setSectionedValue("Colors","col_butntext","1")
  71.     loadedCFG.setSectionedValue("Colors","col_butnhilt","16384")
  72.     loadedCFG.setSectionedValue("Colors","col_titlback","2048")
  73.     loadedCFG.setSectionedValue("Colors","col_titltext","32762")
  74.     loadedCFG.setSectionedValue("Colors","col_titlhilb","8192")
  75.     loadedCFG.setSectionedValue("Colors","col_titlhilt","1")
  76.     loadedCFG.setSectionedValue("OSSettings","oss_showIcons","1")
  77.     loadedCFG.setSectionedValue("OSSettings","oss_version",osVersion)
  78.     loadedCFG.setSectionedValue("Images","img_fileIcon1","System/.osfiles/resources/IMGs/fileIcon1.img")
  79.     loadedCFG.setSectionedValue("Images","img_fileIcon2","System/.osfiles/resources/IMGs/fileIcon2.img")
  80.     loadedCFG.setSectionedValue("Images","img_fileBack1","System/.osfiles/resources/IMGs/fileBack1.img")
  81.     loadedCFG.setSectionedValue("Icons","ico_i1_x","2")
  82.     loadedCFG.setSectionedValue("Icons","ico_i1_y","2")
  83.     loadedCFG.setSectionedValue("Icons","ico_i2_x","14")
  84.     loadedCFG.setSectionedValue("Icons","ico_i2_y","2")
  85.     loadedCFG.save(fs_config)
  86. else
  87.     firstTime = false
  88.     loadedCFG = settings.openSettingsFile(fs_config)
  89.     col_mainback = loadedCFG.getSectionedValue("Colors","col_mainback")
  90.     col_maintext = loadedCFG.getSectionedValue("Colors","col_maintext")
  91.     col_butnback = loadedCFG.getSectionedValue("Colors","col_butnback")
  92.     col_butntitl = loadedCFG.getSectionedValue("Colors","col_butntitl")
  93.     col_butntext = loadedCFG.getSectionedValue("Colors","col_butntext")
  94.     col_butnhilt = loadedCFG.getSectionedValue("Colors","col_butnhilt")
  95.     col_titlback = loadedCFG.getSectionedValue("Colors","col_titlback")
  96.     col_titltext = loadedCFG.getSectionedValue("Colors","col_titltext")
  97.     col_titlhilb = loadedCFG.getSectionedValue("Colors","col_titlhilb")
  98.     col_titlhilt = loadedCFG.getSectionedValue("Colors","col_titlhilt")
  99.     oss_ostype = loadedCFG.getSectionedValue("OSSettings","oss_ostype")
  100.     oss_usertype = loadedCFG.getSectionedValue("OSSettings","oss_usertype")
  101.     oss_version = loadedCFG.getSectionedValue("OSSettings","oss_version")
  102.     loadedCFG.save(fs_config)
  103.     col_mainback = tonumber(col_mainback)
  104.     col_maintext = tonumber(col_maintext)
  105.     col_butnback = tonumber(col_butnback)
  106.     col_butntitl = tonumber(col_butntitl)
  107.     col_butntext = tonumber(col_butntext)
  108.     col_titlback = tonumber(col_titlback)
  109.     col_titltext = tonumber(col_titltext)
  110. end
  111.  
  112. if oss_ostype == "acp_normal" then
  113.     userType = "Adv.Computer"
  114.     osType = "Computer Control"
  115. else
  116.     if firstTime == true then
  117.         if not term.isColor() then
  118.             autos.clean(1,1)
  119.             autos.pError("CRITICAL","OS Error: ADV.COMPUTER REQUIRED")
  120.             sleep(0.1)
  121.             autos.pError("TRUBLSHT","Searching for issue fix...")
  122.             sleep(1.5)
  123.             autos.pError("TRUBLSHT","Upgrade to Adv.Computer")
  124.             return
  125.         else
  126.             loadedCFG = settings.openSettingsFile(fs_config)
  127.             loadedCFG.setSectionedValue("OSSettings","oss_usertype","Adv.Computer")
  128.             loadedCFG.setSectionedValue("OSSettings","oss_ostype","acp_normal")
  129.             loadedCFG.save(fs_config)
  130.             os.reboot()
  131.         end
  132.     else
  133.         autos.clean(1,1)
  134.         autos.pError("CRITICAL","OS Error: INVALID OS TYPE")
  135.         sleep(0.1)
  136.         autos.pError("TRUBLSHT","Searching for issue fix...")
  137.         sleep(1.5)
  138.         autos.pError("TRUBLSHT","Re-install Autos")
  139.         return
  140.     end
  141. end
  142.  
  143. local tv1 = 0.1
  144. local tv2 = 0.3
  145.  
  146. local time1 = math.random(tv1,tv2)
  147. local time2= math.random(tv1,tv2)
  148. local time3 = math.random(tv1,tv2)
  149. local time4 = math.random(tv1,tv2)
  150. local time5 = math.random(tv1,tv2)
  151. local time6 = math.random(tv1,tv2)
  152. local time7 = math.random(tv1,tv2)
  153. local time8 = math.random(tv1,tv2)
  154. local time9 = math.random(tv1,tv2)
  155. local time10 = math.random(tv1,tv2)
  156. local time11 = math.random(tv1,tv2)
  157. local time12 = math.random(tv1,tv2)
  158. local time13 = math.random(tv1,tv2)
  159. local time14 = math.random(tv1,tv2)
  160. local time15 = math.random(tv1,tv2)
  161. local time16 = math.random(tv1,tv2)
  162. local time17 = math.random(tv1,tv2)
  163. local time18 = math.random(tv1,tv2)
  164.  
  165. if not os.getComputerLabel() then
  166.     userLabel = "NO LABEL"
  167. else
  168.     userLabel = os.getComputerLabel()
  169. end
  170.  
  171. autos.bColor(col_mainback)
  172. autos.clean(1,1)
  173.  
  174. autos.draw_Box(box_ospic.x,box_ospic.y,box_ospic.w,box_ospic.h,col_butnback,col_butntitl,box_ospic.t,false)
  175. paintutils.drawImage(bg_mainSplash,31,3)
  176. autos.tColor(col_butntext)
  177. autos.bColor(col_butnback)
  178. autos.setCursor(31,16)
  179. print("Made by AutoLocK")
  180.  
  181. autos.draw_Box(box_osinfo.x,box_osinfo.y,box_osinfo.w,box_osinfo.h,col_butnback,col_butntitl,box_osinfo.t,false)
  182. autos.tColor(col_butntext)
  183. autos.setCursor(4,4)
  184. print("Version:")
  185. autos.setCursor(4,5)
  186. print("Type:")
  187. autos.setCursor(4,6)
  188. print("Label:")
  189. autos.setCursor(13,4)
  190. autos.tColor(col_butnhilt)
  191. print(oss_version)
  192. autos.setCursor(13,5)
  193. print(userType)
  194. autos.setCursor(13,6)
  195. print(userLabel)
  196. autos.setCursor(4,8)
  197. autos.tColor(col_butntitl)
  198. print("---------------------")
  199. autos.setCursor(4,10)
  200. autos.tColor(col_butntext)
  201. print("  WELCOME TO AUTOS!  ")
  202.  
  203. autos.draw_loadingBar(4,15,col_titlback,colors.lime,1)
  204. sleep(time1)
  205. autos.draw_loadingBar(4,15,col_titlback,colors.lime,2)
  206. sleep(time2)
  207. autos.draw_loadingBar(4,15,col_titlback,colors.lime,3)
  208. sleep(time3)
  209. autos.draw_loadingBar(4,15,col_titlback,colors.lime,4)
  210. sleep(time4)
  211. autos.draw_loadingBar(4,15,col_titlback,colors.lime,5)
  212. sleep(time5)
  213. autos.draw_loadingBar(4,15,col_titlback,colors.lime,6)
  214. sleep(time6)
  215. autos.draw_loadingBar(4,15,col_titlback,colors.lime,7)
  216. sleep(time7)
  217. autos.draw_loadingBar(4,15,col_titlback,colors.lime,8)
  218. sleep(time8)
  219. autos.draw_loadingBar(4,15,col_titlback,colors.lime,9)
  220. sleep(time9)
  221. autos.draw_loadingBar(4,15,col_titlback,colors.lime,10)
  222. sleep(time10)
  223. autos.draw_loadingBar(4,15,col_titlback,colors.lime,11)
  224. sleep(time11)
  225. autos.draw_loadingBar(4,15,col_titlback,colors.lime,12)
  226. sleep(time12)
  227. autos.draw_loadingBar(4,15,col_titlback,colors.lime,13)
  228. sleep(time13)
  229. autos.draw_loadingBar(4,15,col_titlback,colors.lime,14)
  230. sleep(time14)
  231. autos.draw_loadingBar(4,15,col_titlback,colors.lime,15)
  232. sleep(time15)
  233. autos.draw_loadingBar(4,15,col_titlback,colors.lime,16)
  234. sleep(time16)
  235. autos.draw_loadingBar(4,15,col_titlback,colors.lime,17)
  236. sleep(time17)
  237. autos.draw_loadingBar(4,15,col_titlback,colors.lime,18)
  238. sleep(time18)
  239.  
  240. shell.run(fs_desktop)
  241. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement