Guest User

Untitled

a guest
Dec 13th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.65 KB | None | 0 0
  1. user = user
  2. load1 = "[ ]"
  3. load2 = "[00 ]"
  4. load3 = "[0000 ]"
  5. load4 = "[000000]"
  6.  
  7.  
  8.  
  9.  
  10. os.pullEvent = os.pullEventRaw
  11.  
  12. PVar={_PVarPath="/files/"}
  13. setmetatable(PVar,PVar)
  14.  
  15. PVar._getVariablePath=function(name)
  16. local filepath = fs.combine(PVar["_PVarPath"],name..".var")
  17. if not fs.exists(PVar["_PVarPath"]) then
  18. fs.makeDir(PVar["_PVarPath"])
  19. end
  20. return filepath
  21. end
  22.  
  23. function PVar._assertOnInvalidName(name)
  24. if name:sub(1,1)=="_" then
  25. error("Variable names cannot start with _")
  26. else
  27. local invalidCharPos,_ = name:find("[:/\*|<>;%s]")
  28. if invalidCharPos then
  29. error("Variable names contains invalid character '"..name:sub(invalidCharPos,invalidCharPos).."'")
  30. end
  31. end
  32. end
  33.  
  34. function PVar.__index(tbl,name)
  35. PVar._assertOnInvalidName(name)
  36. local f = io.open(PVar._getVariablePath(name), "r")
  37. if f then
  38. local content = textutils.unserialize(f:read())
  39. f:close()
  40. return content
  41. else
  42. return nil
  43. end
  44. end
  45.  
  46. function PVar.__newindex(tbl,name,value)
  47. PVar._assertOnInvalidName(name)
  48. if value then
  49. local f = io.open(PVar._getVariablePath(name), "w")
  50. assert(f,"FAIL: could not open file")
  51. if f then
  52. f:write(textutils.serialize(value))
  53. f:close()
  54. end
  55. else
  56. fs.delete(PVar._getVariablePath(name))
  57. end
  58. end
  59.  
  60.  
  61. os.pullEvent = os.pullEventRaw
  62. function printFrameLogin()
  63. term.setCursorPos(1,1)
  64. shell.run("clear")
  65.  
  66. print("| ___ __ __ / \\_____________________|")
  67. print("| /___ / | /__ / |")
  68. print("| /____ /___| ____| / |")
  69. print("|__________________/ |")
  70. print("| |")
  71. print("| |")
  72. print("| |")
  73. print("| |")
  74. print("| |")
  75. print("| |")
  76. print("| |")
  77. print("| |")
  78. print("| |")
  79. print("| |")
  80. print("| |")
  81. print("| |")
  82. print("| |")
  83. sleep(0.1)
  84.  
  85. print("| ___ __ __ / | |")
  86. print("| /___ / | /__ / \\_____________________|")
  87. print("| /____ /___| ____| / |")
  88. print("|__________________/ |")
  89. print("| |")
  90. print("| |")
  91. print("| |")
  92. print("| |")
  93. print("| |")
  94. print("| |")
  95. print("| |")
  96. print("| |")
  97. print("| |")
  98. print("| |")
  99. print("| |")
  100. print("| |")
  101. print("| |")
  102. sleep(0.1)
  103.  
  104. print("| ___ __ __ / | |")
  105. print("| /___ / | /__ / | |")
  106. print("| /____ /___| ____| / \\_____________________|")
  107. print("|__________________/ |")
  108. print("| |")
  109. print("| |")
  110. print("| |")
  111. print("| |")
  112. print("| |")
  113. print("| |")
  114. print("| |")
  115. print("| |")
  116. print("| |")
  117. print("| |")
  118. print("| |")
  119. print("| |")
  120. print("| |")
  121. sleep(0.1)
  122.  
  123. print("| ___ __ __ / | |")
  124. print("| /___ / | /__ / | |")
  125. print("| /____ /___| ____| / | |")
  126. print("|__________________/ \\_____________________|")
  127. print("| |")
  128. print("| |")
  129. print("| |")
  130. print("| |")
  131. print("| |")
  132. print("| |")
  133. print("| |")
  134. print("| |")
  135. print("| |")
  136. print("| |")
  137. print("| |")
  138. print("| |")
  139. print("| |")
  140. sleep(0.1)
  141. end
  142.  
  143. function printFrameLogin2()
  144. term.setCursorPos(1,1)
  145. shell.run("clear")
  146.  
  147. print("| ___ __ __ / | |")
  148. print("| /___ / | /__ / | |")
  149. print("| /____ /___| ____| / | |")
  150. print("|__________________/ \\_____________________|")
  151. print("| |")
  152. print("| |")
  153. print("| |")
  154. print("| |")
  155. print("| |")
  156. print("| |")
  157. print("| |")
  158. print("| |")
  159. print("| |")
  160. print("| |")
  161. print("| |")
  162. print("| |")
  163. print("| |")
  164. sleep(0.1)
  165.  
  166. print("| ___ __ __ / | |")
  167. print("| /___ / | /__ / | |")
  168. print("| /____ /___| ____| / \\_____________________|")
  169. print("|__________________/ |")
  170. print("| |")
  171. print("| |")
  172. print("| |")
  173. print("| |")
  174. print("| |")
  175. print("| |")
  176. print("| |")
  177. print("| |")
  178. print("| |")
  179. print("| |")
  180. print("| |")
  181. print("| |")
  182. print("| |")
  183. sleep(0.1)
  184.  
  185. print("| ___ __ __ / | |")
  186. print("| /___ / | /__ / \\_____________________|")
  187. print("| /____ /___| ____| / |")
  188. print("|__________________/ |")
  189. print("| |")
  190. print("| |")
  191. print("| |")
  192. print("| |")
  193. print("| |")
  194. print("| |")
  195. print("| |")
  196. print("| |")
  197. print("| |")
  198. print("| |")
  199. print("| |")
  200. print("| |")
  201. print("| |")
  202. sleep(0.1)
  203.  
  204. print("| ___ __ __ / \\_____________________|")
  205. print("| /___ / | /__ / |")
  206. print("| /____ /___| ____| / |")
  207. print("|__________________/ |")
  208. print("| |")
  209. print("| |")
  210. print("| |")
  211. print("| |")
  212. print("| |")
  213. print("| |")
  214. print("| |")
  215. print("| |")
  216. print("| |")
  217. print("| |")
  218. print("| |")
  219. print("| |")
  220. print("| |")
  221. sleep(0.1)
  222. end
  223.  
  224. term.clear()
  225. term.setCursorPos(1,1)
  226. printFrameLogin()
  227. term.setCursorPos(27,1)
  228. Ehwhatpass = PVar.pass
  229. sleep(0.3)
  230. write("Username: ")
  231. user = read()
  232. term.setCursorPos(49,1)
  233. write("|")
  234. if user == PVar.user then
  235. term.setCursorPos(27,2)
  236. write("Password: ")
  237. p1 = read("*")
  238. term.setCursorPos(49,2)
  239. write("|")
  240. if p1 == Ehwhatpass then
  241. printFrameLogin2()
  242. shell.run("gui1")
  243. else
  244. term.setCursorPos(27,3)
  245. print("Password Incorrect!")
  246. sleep(2)
  247. printFrameLogin2()
  248. shell.run("startup")
  249. end
  250. else
  251. term.setCursorPos(27,3)
  252. print("Username Incorrect!")
  253. sleep(2)
  254. printFrameLogin2()
  255. shell.run("startup")
  256. end
Add Comment
Please, Sign In to add comment