Advertisement
TaZeOS

OS/Programs/AdminControl/start.lua

Nov 3rd, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. log(" ")
  2. log(" ")
  3. log("Admin Panel Started")
  4. log(" ")
  5. log(" ")
  6.  
  7.  
  8. function s(...) return sleep(...) end
  9. function w(...) return write(...) end
  10. function p(...) return print(...) end
  11. function tw(...) return term.write(...) end
  12. function scp(...) return term.setCursorPos(...) end
  13. function sbc(...) return term.setBackgroundColor(...) end
  14. function stc(...) return term.setTextColor(...) end
  15. function tc(...) return term.clear(...) end
  16. function tcl(...) return term.clearLine() end
  17. function scb(...) return term.setCursorBlink(...) end
  18. function ts(...) return term.scroll(...) end
  19. function r(...) return shell.run(...) end
  20. function para(...) return parallel.waitForAny(...) end
  21. function sw(...) return textutils.slowWrite(...) end
  22. function sp(...) return textutils.slowPrint(...) end
  23. log("==> Adding taskbar")
  24. taskbar.setVisible(true)
  25. log("==> Creating app window")
  26. terminalwindow = window.create(term.current(),1,2,51,18)
  27. terminalwindow.setBackgroundColor(colors.orange)
  28. terminalwindow.clear()
  29. logo = paintutils.loadImage("OS/Programs/AdminControl/admin.png")
  30. paintutils.drawImage(logo, 1, 1 )
  31. terminalwindow.setCursorPos(20,15)
  32. terminalwindow.setTextColor(colors.white)
  33. terminalwindow.setBackgroundColor(colors.orange)
  34. terminalwindow.write(" Admin")
  35. if admin == "true" then
  36.  
  37. else
  38. adminpopup = window.create(term.current(),12,7,25,10)
  39. adminpopup.setBackgroundColor(colors.white)
  40. adminpopup.clear()
  41. adminpopup.setCursorPos(1,1)
  42. adminpopup.setBackgroundColor(colors.red)
  43. adminpopup.write(" Admin Login ")
  44. adminpopup.setTextColor(colors.orange)
  45. adminpopup.setCursorPos(2,2)
  46. adminpopup.setBackgroundColor(colors.white)
  47. adminpopup.write("Please login as a admin.")
  48. adminpopup.setCursorPos(2,3)
  49. adminpopup.write("To access \"Admin Panel\"")
  50. adminpopup.setCursorPos(2,5)
  51. adminpopup.write("Username:")
  52. adminpopup.setCursorPos(2,6)
  53. adminpopup.setBackgroundColor(colors.lightGray)
  54. adminpopup.write(" ")
  55. adminpopup.setCursorPos(2,8)
  56. adminpopup.setBackgroundColor(colors.white)
  57. adminpopup.write("Password:")
  58. adminpopup.setCursorPos(2,9)
  59. adminpopup.setBackgroundColor(colors.lightGray)
  60. adminpopup.write(" ")
  61.  
  62. while true do
  63.  
  64.  
  65. scp(13,12)
  66. sbc(colors.lightGray)
  67. username = read()
  68. scp(13,15)
  69. sbc(colors.lightGray)
  70. password = read("*")
  71. logincheck = fs.open("OS/Users/1/info.data", "r")
  72. if logincheck then
  73. username1 = logincheck.readLine()
  74. userpass1 = logincheck.readLine()
  75. admin = logincheck.readLine()
  76. logincheck.close()
  77. end
  78.  
  79. TaZerOS.checkUser()
  80.  
  81. if username == UserInfo[1][1] and password == UserInfo[1][2] and admin1 == "true" or username == UserInfo[2][1] and password == UserInfo[2][2] and admin2 == "true" or username == UserInfo[3][1] and password == UserInfo[3][2] and admin3 == "true" or username == UserInfo[4][1] and password == UserInfo[4][2] and admin4 == "true" then
  82.  
  83. logincheck = fs.open("OS/Users/1/info.data", "r")
  84. if logincheck then
  85. username1 = logincheck.readLine()
  86. userpass1 = logincheck.readLine()
  87. admin = logincheck.readLine()
  88. logincheck.close()
  89. end
  90.  
  91.  
  92. terminalwindow.clear()
  93. paintutils.drawImage(logo, 1, 1 )
  94. terminalwindow.setCursorPos(20,15)
  95. terminalwindow.setTextColor(colors.white)
  96. terminalwindow.setBackgroundColor(colors.orange)
  97. terminalwindow.write("Admin")
  98.  
  99. break
  100. else
  101. shell.run('OS/desktop.lua')
  102.  
  103. end
  104. end
  105.  
  106. end
  107. sleep(4)
  108. log("==> Prossecing animation")
  109. terminalwindow.setBackgroundColor(colors.orange)
  110. terminalwindow.clear()
  111. paintutils.drawImage(logo, 5, 1 )
  112. terminalwindow.setCursorPos(25,15)
  113. terminalwindow.setTextColor(colors.white)
  114. terminalwindow.setBackgroundColor(colors.orange)
  115. terminalwindow.write(" Admin")
  116. sleep(0.1)
  117.  
  118.  
  119.  
  120.  
  121. terminalwindow.setBackgroundColor(colors.orange)
  122. terminalwindow.clear()
  123. paintutils.drawImage(logo, 10, 1 )
  124. terminalwindow.setCursorPos(30,15)
  125. terminalwindow.setTextColor(colors.white)
  126. terminalwindow.setBackgroundColor(colors.orange)
  127. terminalwindow.write(" Admin")
  128. sleep(0.1)
  129.  
  130.  
  131.  
  132. terminalwindow.setBackgroundColor(colors.orange)
  133. terminalwindow.clear()
  134. paintutils.drawImage(logo, 15, 1 )
  135. terminalwindow.setCursorPos(35,15)
  136. terminalwindow.setTextColor(colors.white)
  137. terminalwindow.setBackgroundColor(colors.orange)
  138. terminalwindow.write(" Admin")
  139. sleep(0.1)
  140.  
  141.  
  142.  
  143.  
  144. terminalwindow.setBackgroundColor(colors.orange)
  145. terminalwindow.clear()
  146. paintutils.drawImage(logo, 20, 1 )
  147. terminalwindow.setCursorPos(40,15)
  148. terminalwindow.setTextColor(colors.white)
  149. terminalwindow.setBackgroundColor(colors.orange)
  150. terminalwindow.write(" Admin")
  151. sleep(0.1)
  152.  
  153.  
  154.  
  155. terminalwindow.setBackgroundColor(colors.orange)
  156. terminalwindow.clear()
  157. paintutils.drawImage(logo, 25, 1 )
  158. terminalwindow.setCursorPos(45,15)
  159. terminalwindow.setTextColor(colors.white)
  160. terminalwindow.setBackgroundColor(colors.orange)
  161. terminalwindow.write(" Admin")
  162. sleep(0.1)
  163.  
  164.  
  165.  
  166. terminalwindow.setBackgroundColor(colors.orange)
  167. terminalwindow.clear()
  168. paintutils.drawImage(logo, 30, 1 )
  169. terminalwindow.setCursorPos(50,15)
  170. terminalwindow.setTextColor(colors.white)
  171. terminalwindow.setBackgroundColor(colors.orange)
  172. terminalwindow.write(" Admin")
  173. sleep(0.1)
  174.  
  175.  
  176.  
  177. terminalwindow.setBackgroundColor(colors.orange)
  178. terminalwindow.clear()
  179. paintutils.drawImage(logo, 32, 1 )
  180. terminalwindow.setCursorPos(51,15)
  181. terminalwindow.setTextColor(colors.white)
  182. terminalwindow.setBackgroundColor(colors.orange)
  183. terminalwindow.write(" Admin")
  184. sleep(0.1)
  185.  
  186.  
  187. terminalwindow.setBackgroundColor(colors.orange)
  188. terminalwindow.clear()
  189. paintutils.drawImage(logo, 35, 1 )
  190.  
  191. sleep(2)
  192. taskbar.setCursorPos(1,1)
  193. log("==> Admin Panel Started!")
  194. taskbar.write(" Admin Panel")
  195.  
  196. term.clear()
  197.  
  198. adminpanel = window.create(term.current(),1,2,51,18)
  199. adminpanel.setBackgroundColor(colors.white)
  200. adminpanel.clear()
  201. taskbar.clear()
  202. taskbar.setCursorPos(1,1)
  203. taskbar.write(" Admin Panel")
  204. sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement