Advertisement
HaZePug

Settings

Feb 17th, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.59 KB | None | 0 0
  1. function s(...) return sleep(...) end
  2. function w(...) return write(...) end
  3. function p(...) return print(...) end
  4. function tw(...) return term.write(...) end
  5. function scp(...) return term.setCursorPos(...) end
  6. function sbc(...) return term.setBackgroundColor(...) end
  7. function stc(...) return term.setTextColor(...) end
  8. function tc(...) return term.clear(...) end
  9. function tcl(...) return term.clearLine() end
  10. function scb(...) return term.setCursorBlink(...) end
  11. function ts(...) return term.scroll(...) end
  12. function r(...) return shell.run(...) end
  13. function para(...) return parallel.waitForAny(...) end
  14. function sw(...) return textutils.slowWrite(...) end
  15. function sp(...) return textutils.slowPrint(...) end
  16.  
  17.  
  18.  
  19.  
  20. os.pullEvent = os.pullEventRaw
  21.  
  22. -- Change Username Function
  23. function username()
  24. logincheck = fs.open("disk/users/1", "r")
  25. if logincheck then
  26. username1 = logincheck.readLine()
  27.  
  28. userpass1 = logincheck.readLine()
  29. end
  30. logincheck = fs.open("disk/users/2", "r")
  31. if logincheck then
  32. username2 = logincheck.readLine()
  33.  
  34. userpass2 = logincheck.readLine()
  35. end
  36.  
  37. if loggedinuser == (username1) then
  38. scp(2,8)
  39. w([[ ]])
  40. scp(2,8)
  41. newusername = read()
  42.  
  43. writeusername = fs.open("disk/users/1", "w")
  44. writeusername.writeLine(newusername)
  45. writeusername.writeLine(therepassword)
  46.  
  47. writeusername.close()
  48. sbc( colors.white )
  49. stc( colors.black )
  50. scp(2,5)
  51. term.clearLine()
  52. scp(2,8)
  53. term.clearLine()
  54. scp(2,10)
  55. term.clearLine()
  56. scp(15,8)
  57. print("These Changes Require A Reboot")
  58. scp(15,9)
  59. print("Reboot now?")
  60. scp(14,11)
  61. stc(1)
  62. sbc( colors.lime )
  63. print(" Yes ")
  64. scp(21,11)
  65. sbc( colors.red )
  66. stc(1)
  67. print(" No ")
  68.  
  69. while true do
  70. event, button, X, Y = os.pullEvent("mouse_click")
  71.  
  72. if X >= 14 and X <= 19 and Y == 11 then
  73. sbc( colors.white )
  74. term.clear()
  75. sleep(2)
  76. os.reboot()
  77. elseif X >= 21 and X <= 25 and Y == 11 then
  78. shell.run('Services/Desktop')
  79. end
  80. end
  81.  
  82. elseif loggedinuser == (username2) then
  83. scp(2,8)
  84. w([[ ]])
  85. scp(2,8)
  86. newusername = read()
  87.  
  88. writeusername = fs.open("disk/users/2", "w")
  89. writeusername.writeLine(newusername)
  90. writeusername.writeLine(therepassword)
  91.  
  92. writeusername.close()
  93.  
  94. end
  95. end
  96. ----------------------------------------
  97. function password()
  98. logincheck = fs.open("disk/users/1", "r")
  99. if logincheck then
  100. username1 = logincheck.readLine()
  101.  
  102. userpass1 = logincheck.readLine()
  103. end
  104. logincheck = fs.open("disk/users/2", "r")
  105. if logincheck then
  106. username2 = logincheck.readLine()
  107.  
  108. userpass2 = logincheck.readLine()
  109. end
  110.  
  111. if loggedinuser == (username1) then
  112. scp(2,10)
  113. w([[ ]])
  114. scp(2,10)
  115. newpassword = read()
  116.  
  117. writeusername = fs.open("disk/users/1", "w")
  118. writeusername.writeLine(username1)
  119. writeusername.writeLine(newpassword)
  120.  
  121. writeusername.close()
  122. sbc( colors.white )
  123. stc( colors.black )
  124. scp(2,5)
  125. term.clearLine()
  126. scp(2,8)
  127. term.clearLine()
  128. scp(2,10)
  129. term.clearLine()
  130. scp(15,8)
  131. print("These Changes Require A Reboot")
  132. scp(15,9)
  133. print("Reboot now?")
  134. scp(14,11)
  135. stc(1)
  136. sbc( colors.lime )
  137. print(" Yes ")
  138. scp(21,11)
  139. sbc( colors.red )
  140. stc(1)
  141. print(" No ")
  142.  
  143. while true do
  144. event, button, X, Y = os.pullEvent("mouse_click")
  145.  
  146. if X >= 14 and X <= 19 and Y == 11 then
  147. sbc( colors.white )
  148. term.clear()
  149. sleep(2)
  150. os.reboot()
  151. elseif X >= 21 and X <= 25 and Y == 11 then
  152. shell.run('Services/Desktop')
  153. end
  154. end
  155.  
  156. elseif loggedinuser == (username2) then
  157. scp(2,10)
  158. w([[ ]])
  159. scp(2,10)
  160. newpassword = read()
  161.  
  162. writeusername = fs.open("disk/users/2", "w")
  163. writeusername.writeLine(username2)
  164. writeusername.writeLine(newpassword)
  165.  
  166. writeusername.close()
  167.  
  168. end
  169. end
  170.  
  171.  
  172.  
  173.  
  174. -- Options Functions
  175. -- ## Profile ## --
  176. function profile()
  177. scp(50,1)
  178. sbc( colors.lightGray )
  179. stc( colors.orange )
  180. print("@")
  181. scp(2,5)
  182. sbc( colors.white )
  183. stc( colors.black )
  184. print("Username: ", loggedinuser)
  185. scp(2,6)
  186. sbc( colors.lightGray )
  187. stc(1)
  188. scp(2,8)
  189. print(" Change Username ")
  190. scp(2,10)
  191. print(" Change Password ")
  192.  
  193. -- click events while the user is looking at option profile
  194. while true do
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. event, button, X, Y = os.pullEvent("mouse_click")
  202.  
  203. if X >= 2 and X <= 19 and Y == 8 then
  204. username()
  205.  
  206. elseif X >= 2 and X <= 19 and Y == 10 then
  207.  
  208. password()
  209.  
  210. elseif X >= 51 and X <= 51 and Y == 1 then
  211. shell.run('Services/Desktop')
  212. elseif X >= 50 and X <= 50 and Y == 1 then
  213. shell.run('Programs/Settings')
  214.  
  215. end
  216. end
  217. end
  218. --#### CHANGE USER 1 BACKGROUND ####--
  219.  
  220.  
  221. --########System########--
  222.  
  223. function System()
  224.  
  225. scp(50,1)
  226. sbc( colors.lightGray )
  227. stc( colors.orange )
  228. print("@")
  229. stc( colors.white )
  230. scp(6,6)
  231. sbc( colors.blue )
  232. print(" ")
  233. scp(6,7)
  234. print(" ")
  235. scp(6,7)
  236. print(" OS: TaZerOS ", version)
  237. scp(6,8)
  238. print(" ")
  239.  
  240. scp(6,10)
  241. print(" ")
  242. scp(6,11)
  243. print(" ")
  244. scp(6,11)
  245. print(" Checking For Update... ")
  246. scp(6,12)
  247. print(" ")
  248. sleep(4)
  249. if version == (OnlineVersion) then
  250. scp(6,11)
  251. print(" Your on the latest version ")
  252. else
  253. scp(6,11)
  254. print(" ")
  255. scp(6,11)
  256. print(" Update Available. ", OnlineVersion)
  257.  
  258. sbc( colors.green )
  259. scp(6,14)
  260. print(" UPDATE ")
  261. updatebutton = "yes"
  262.  
  263.  
  264. while true do
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. event, button, X, Y = os.pullEvent("mouse_click")
  272.  
  273. if X >= 6 and X <= 14 and Y == 14 and updatebutton == "yes" then
  274. shell.run('disk/updates/UpdaterProgram')
  275.  
  276. elseif X >= 51 and X <= 51 and Y == 1 then
  277. shell.run('Services/Desktop')
  278. elseif X >= 50 and X <= 50 and Y == 1 then
  279. shell.run('Programs/Settings')
  280.  
  281. end
  282. end
  283.  
  284.  
  285. end
  286. end
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303. --#####Background#######--
  304. function background()
  305.  
  306. while true do
  307.  
  308. scp(50,1)
  309. sbc( colors.lightGray )
  310. stc( colors.orange )
  311. print("@")
  312. stc(1)
  313. if username1 == (loggedinuser) then
  314. backgrounds = fs.open("disk/Users/.1data", "r")
  315. background = backgrounds.readLine()
  316. backgrounds.close()
  317. elseif username2 == (loggedinuser) then
  318. backgrounds = fs.open("disk/Users/.2data", "r")
  319. background = backgrounds.readLine()
  320. backgrounds.close()
  321. end
  322. if background == "Textures/backgrounds/computer" then
  323. scp(4,4)
  324. sbc( colors.blue )
  325. print(" Computer ")
  326. else
  327. scp(4,4)
  328. sbc( colors.lightGray )
  329. print(" Computer ")
  330. end
  331. if background == "Textures/backgrounds/code" then
  332. scp(16,4)
  333. sbc( colors.blue )
  334. print(" Code ")
  335. else
  336. scp(16,4)
  337. sbc( colors.lightGray )
  338. print(" Code ")
  339. end
  340. -- EVENTS
  341.  
  342. -- MOUSE CLICK
  343. event, button, X, Y = os.pullEvent("mouse_click")
  344.  
  345. if X >= 4 and X <= 14 and Y == 4 and loggedinuser == (username1) then
  346. logincheck = fs.open("disk/users/1", "r")
  347.  
  348. username1 = logincheck.readLine()
  349.  
  350. userpass1 = logincheck.readLine()
  351.  
  352. logincheck = fs.open("disk/users/2", "r")
  353.  
  354. username2 = logincheck.readLine()
  355.  
  356. userpass2 = logincheck.readLine()
  357.  
  358. backgrounds = fs.open("disk/Users/.1data", "w")
  359. backgrounds.writeLine("Textures/backgrounds/computer")
  360. backgrounds.close()
  361. elseif X >= 16 and X <= 21 and Y == 4 and loggedinuser == (username1) then
  362. logincheck = fs.open("disk/users/1", "r")
  363. username1 = logincheck.readLine()
  364.  
  365. userpass1 = logincheck.readLine()
  366.  
  367. logincheck = fs.open("disk/users/2", "r")
  368.  
  369. username2 = logincheck.readLine()
  370.  
  371. userpass2 = logincheck.readLine()
  372.  
  373. backgrounds = fs.open("disk/Users/.1data", "w")
  374. backgrounds.writeLine("Textures/backgrounds/code")
  375. backgrounds.close()
  376. --
  377. elseif X >= 4 and X <= 14 and Y == 4 and loggedinuser == (username2) then
  378. logincheck = fs.open("disk/users/1", "r")
  379.  
  380. username1 = logincheck.readLine()
  381.  
  382. userpass1 = logincheck.readLine()
  383.  
  384. logincheck = fs.open("disk/users/2", "r")
  385.  
  386. username2 = logincheck.readLine()
  387.  
  388. userpass2 = logincheck.readLine()
  389.  
  390. backgrounds = fs.open("disk/Users/.2data", "w")
  391. backgrounds.writeLine("Textures/backgrounds/computer")
  392. backgrounds.close()
  393. elseif X >= 16 and X <= 21 and Y == 4 and loggedinuser == (username2) then
  394. logincheck = fs.open("disk/users/1", "r")
  395. username1 = logincheck.readLine()
  396.  
  397. userpass1 = logincheck.readLine()
  398.  
  399. logincheck = fs.open("disk/users/2", "r")
  400.  
  401. username2 = logincheck.readLine()
  402.  
  403. userpass2 = logincheck.readLine()
  404.  
  405. backgrounds = fs.open("disk/Users/.2data", "w")
  406. backgrounds.writeLine("Textures/backgrounds/code")
  407. backgrounds.close()
  408.  
  409. --
  410. elseif X >= 50 and X <= 50 and Y == 1 then
  411. shell.run('Programs/Settings')
  412. end
  413.  
  414. end
  415. end
  416.  
  417.  
  418. --------------------------
  419.  
  420.  
  421.  
  422.  
  423. -- Background And Task Bar
  424. sbc(1)
  425. term.clear()
  426. scp(1,1)
  427. sbc( colors.lightGray )
  428.  
  429. w([[ ]])
  430. scp(51,1)
  431. stc( colors.red )
  432. print("@")
  433. scp(1,1)
  434. stc(1)
  435. print("Settings")
  436.  
  437. scp(21,1)
  438. stc( colors.white )
  439. sbc( colors.green )
  440. w([[ Panel ]])
  441.  
  442.  
  443.  
  444. --Options---------------------------------------------
  445. sbc( colors.lightGray )
  446. scp(2,5)
  447. p([[ ]])
  448. scp(2,6)
  449. p([[ Profile ]])
  450. scp(2,7)
  451. p([[ ]])
  452. scp(15,5)
  453. p([[ ]])
  454. scp(15,6)
  455. p([[ Background ]])
  456. scp(15,7)
  457. p([[ ]])
  458. scp(29,5)
  459. p([[ ]])
  460. scp(29,6)
  461. p([[ System ]])
  462. scp(29,7)
  463. p([[ ]])
  464.  
  465.  
  466. while true do
  467.  
  468. event, button, X, Y = os.pullEvent("mouse_click")
  469.  
  470. if X >= 2 and X <= 12 and Y >= 5 and Y <= 7 then
  471. sbc(1)
  472. term.clear()
  473. sbc(1)
  474. term.clear()
  475. scp(1,1)
  476. sbc( colors.lightGray )
  477.  
  478. w([[ ]])
  479. scp(51,1)
  480. stc( colors.red )
  481. print("@")
  482. scp(1,1)
  483. stc(1)
  484. print("Settings")
  485.  
  486. scp(21,1)
  487. stc( colors.white )
  488. sbc( colors.green )
  489. w([[ Panel ]])
  490. profile()
  491. elseif X >= 29 and X <= 41 and Y >= 5 and Y <= 7 then
  492. sbc(1)
  493. term.clear()
  494. sbc(1)
  495. term.clear()
  496. scp(1,1)
  497. sbc( colors.lightGray )
  498.  
  499. w([[ ]])
  500. scp(51,1)
  501. stc( colors.red )
  502. print("@")
  503. scp(1,1)
  504. stc(1)
  505. print("Settings")
  506.  
  507. scp(21,1)
  508. stc( colors.white )
  509. sbc( colors.green )
  510. w([[ Panel ]])
  511. System()
  512. elseif X >= 15 and X <= 27 and Y >= 5 and Y <= 7 then
  513. sbc(1)
  514. term.clear()
  515. sbc(1)
  516. term.clear()
  517. scp(1,1)
  518. sbc( colors.lightGray )
  519.  
  520. w([[ ]])
  521. scp(51,1)
  522. stc( colors.red )
  523. print("@")
  524. scp(1,1)
  525. stc(1)
  526. print("Settings")
  527.  
  528. scp(21,1)
  529. stc( colors.white )
  530. sbc( colors.green )
  531. w([[ Panel ]])
  532. background()
  533.  
  534. elseif X >= 51 and X <= 51 and Y == 1 then
  535. shell.run('Services/Desktop')
  536.  
  537.  
  538. end
  539. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement