Guest User

Untitled

a guest
Dec 13th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.19 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. sleep(0.1)
  83.  
  84. print("| ___ __ __ / | |")
  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. sleep(0.1)
  101.  
  102. print("| ___ __ __ / | |")
  103. print("| /___ / | /__ / | |")
  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. sleep(0.1)
  119.  
  120. print("| ___ __ __ / | |")
  121. print("| /___ / | /__ / | |")
  122. print("| /____ /___| ____| / | |")
  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. sleep(0.1)
  137. end
  138.  
  139. function printFrameLogin2()
  140. term.setCursorPos(1,1)
  141. shell.run("clear")
  142.  
  143. print("| ___ __ __ / | |")
  144. print("| /___ / | /__ / | |")
  145. print("| /____ /___| ____| / | |")
  146. print("|__________________/ \\_____________________|")
  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. sleep(0.1)
  160.  
  161. print("| ___ __ __ / | |")
  162. print("| /___ / | /__ / | |")
  163. print("| /____ /___| ____| / \\_____________________|")
  164. print("|__________________/ |")
  165. print("| |")
  166. print("| |")
  167. print("| |")
  168. print("| |")
  169. print("| |")
  170. print("| |")
  171. print("| |")
  172. print("| |")
  173. print("| |")
  174. print("| |")
  175. print("| |")
  176. print("| |")
  177. sleep(0.1)
  178.  
  179. print("| ___ __ __ / | |")
  180. print("| /___ / | /__ / \\_____________________|")
  181. print("| /____ /___| ____| / |")
  182. print("|__________________/ |")
  183. print("| |")
  184. print("| |")
  185. print("| |")
  186. print("| |")
  187. print("| |")
  188. print("| |")
  189. print("| |")
  190. print("| |")
  191. print("| |")
  192. print("| |")
  193. print("| |")
  194. print("| |")
  195. sleep(0.1)
  196.  
  197. print("| ___ __ __ / \\_____________________|")
  198. print("| /___ / | /__ / |")
  199. print("| /____ /___| ____| / |")
  200. print("|__________________/ |")
  201. print("| |")
  202. print("| |")
  203. print("| |")
  204. print("| |")
  205. print("| |")
  206. print("| |")
  207. print("| |")
  208. print("| |")
  209. print("| |")
  210. print("| |")
  211. print("| |")
  212. print("| |")
  213. sleep(0.1)
  214. end
  215.  
  216. term.clear()
  217. term.setCursorPos(1,1)
  218. printFrameLogin()
  219. term.setCursorPos(27,2)
  220. Ehwhatpass = PVar.pass
  221. sleep(0.3)
  222. write("Username: ")
  223. user = read()
  224. term.setCursorPos(49,2)
  225. write("|")
  226. if user == PVar.user then
  227. term.setCursorPos(27,3)
  228. write("Password: ")
  229. p1 = read("*")
  230. term.setCursorPos(49,3)
  231. write("|")
  232. if p1 == Ehwhatpass then
  233. printFrameLogin2()
  234. shell.run("gui1")
  235. else
  236. term.setCursorPos(27,4)
  237. print("Password Incorrect!")
  238. sleep(2)
  239. printFrameLogin2()
  240. shell.run("startup")
  241. end
  242. else
  243. term.setCursorPos(27,4)
  244. print("Username Incorrect!")
  245. sleep(2)
  246. printFrameLogin2()
  247. shell.run("startup")
  248. end
Add Comment
Please, Sign In to add comment