Advertisement
Guest User

startuptest

a guest
Sep 12th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.82 KB | None | 0 0
  1. os.pullEvent=os.pullEventRaw
  2. version="MultiUser Alpha 1.2.02 The Infinite Update"
  3. term.clear()
  4. print("Loading GUI")
  5. os.loadAPI("GUI")
  6. print("Loading paintutils for 1.79")
  7. os.loadAPI("paintutils")
  8. print("Loaded "..version)
  9. sleep(2)
  10. term.clear()
  11. GUI.fbox(colours.grey)
  12. ccY=3
  13. term.setCursorPos(3,ccY)
  14. ccY=ccY+1
  15. term.setTextColor(colours.lightGrey)
  16. term.setBackgroundColor(colours.grey)
  17. term.write("Starting...")
  18. user=_G.user
  19. pass=""
  20. lion=false
  21. term.setCursorPos(3,ccY)
  22. ccY=ccY+1
  23. sleep(0.5)
  24. getfenv(("").gsub).user={
  25. user="";
  26. pass="";
  27. valid=false;
  28. invalidReason="";
  29. }
  30. term.write("Loaded Blacknet")
  31. sleep(1)
  32. GUI.bar()
  33. user=""
  34. sleep(2)
  35. term.setBackgroundColor(colours.lightGrey)
  36. term.clear()
  37. errorTimerValue=0
  38. os.startTimer(1)
  39. while true do
  40. e,p1,p2,p3,p4,p5=os.pullEvent()
  41. if user=="breaker" then
  42. term.setCursorPos(1,tY-1)
  43. if pass=="Halo5" then
  44. term.write("Program Closing")
  45. sleep(2)
  46. break
  47. end --if pass=="<CENSOR>"
  48. end --if user=="breaker"
  49. if user=="" then
  50. _G.user="Not Logged In!"
  51. else --if user==""
  52. _G.user="Login as: "..user
  53. if lion==true then
  54. _G.user=user
  55. end --if lion==true 3
  56. end --if user=="" --else
  57. if e=="timer" then
  58. term.setBackgroundColor(colours.lightGrey)
  59. term.setCursorPos(1,1)
  60. term.clear()
  61. GUI.bar()
  62. if lion==true then
  63. term.setCursorPos(1,2)
  64. term.setBackgroundColor(colours.red)
  65. paintutils.drawLine(1,2,10,2)
  66. term.setCursorPos(1,2)
  67. term.write("Log out")
  68. else --if lion==true
  69. term.setBackgroundColor(colours.green)
  70. paintutils.drawLine(1,2,10,2)
  71. term.setCursorPos(1,2)
  72. term.write("Log in")
  73. if errorTimerValue>0 then
  74. errorTimerValue=errorTimerValue-1
  75. if getfenv(("").gsub).user.invalidReason=="" then
  76.  
  77. else --if getfenv(("").gsub).user.invalidReason
  78. term.setCursorPos(1,4)
  79. term.setBackgroundColor(colours.red)
  80. paintutils.drawLine(1,4,25,4)
  81. term.setCursorPos(1,4)
  82. term.setTextColor(colours.white)
  83. term.write(getfenv(("").gsub).user.invalidReason)
  84. end --if getfenv(("").gsub).user.invalidReason --else
  85. end --if errorTimerValue>0
  86. tX,tY=term.getSize()
  87. term.setCursorPos(1,tY)
  88. term.setBackgroundColor(colours.lightGrey)
  89. term.setTextColor(colours.white)
  90. term.write(version)
  91. term.setCursorPos(1,5)
  92. term.write("Username:")
  93. term.setBackgroundColor(colours.white)
  94. term.setTextColor(colours.black)
  95. paintutils.drawLine(1,6,25,6)
  96. paintutils.drawLine(1,8,25,8)
  97. term.setCursorPos(1,6)
  98. term.write(user)
  99. term.setCursorPos(1,8)
  100. if pass=="" then
  101. else
  102. for it2=1,#pass do
  103. term.write("*")
  104. end --for it2=1,#pass
  105. end --if pass=="" --else
  106. --This ^ will be removed soon due to screen peek
  107. --It was only here for debug purposes
  108. --This was removed in version prealpha
  109. term.setTextColor(colours.white)
  110. term.setCursorPos(1,7)
  111. term.setBackgroundColor(colours.lightGrey)
  112. term.write("Password:")
  113. end --if lion==true --else
  114. os.startTimer(1)
  115. end --if e=="timer"
  116. if e=="mouse_click" then
  117. if p2<6 then
  118. if p3>1 then
  119. if p3<3 then
  120. if lion==true then
  121. lion=false
  122. user=""
  123. pass=""
  124. getfenv(("").gsub).user.user=""
  125. getfenv(("").gsub).user.pass=""
  126. else --if lion==true 2
  127. getfenv(("").gsub).user.user=user
  128. getfenv(("").gsub).user.pass=pass
  129. term.setBackgroundColor(colours.grey)
  130. paintutils.drawLine(1,2,10,2)
  131. term.setCursorPos(1,2)
  132. term.write("Working...")
  133. os.startTimer(3)
  134. ccd=2
  135. while true do
  136. e=os.pullEvent()
  137. if e=="timer" then
  138. ccd=ccd-1
  139. if getfenv(("").gsub).user.valid==true then
  140. lion=true
  141. else --if getfenv(("").gsub).user.valid
  142. lion=false
  143. errorTimerValue=5
  144. end --if getfenv(("").gsub).user.valid --else
  145. if ccd==0 then
  146. break
  147. end --if ccd==0
  148. end --if e=="timer"
  149. os.startTimer(1)
  150. end --while true
  151. end --if lion==true 2 --else
  152. end --if p3<3
  153. end --if p3>1
  154. end --if p2>6
  155. if lion==false then
  156. if p2<26 then
  157. if p3>5 then
  158. if p3<7 then
  159. --Begin Enter User
  160. term.setCursorPos(1,tY-1)
  161. term.clearLine()
  162. term.write("Enter Your Username into the field")
  163. term.setBackgroundColor(colours.white)
  164. term.setTextColor(colours.black)
  165. paintutils.drawLine(1,6,25,6)
  166. term.setCursorPos(1,6)
  167. user=read()
  168. term.setBackgroundColor(colours.lightGrey)
  169. term.setTextColor(colours.white)
  170. term.setCursorPos(1,tY-2)
  171. term.write("Working...")
  172. sleep(1)
  173. os.startTimer(1)
  174. term.setTextColor(colours.white)
  175. end --if p3<7
  176. end --if p3>5
  177. if p3>7 then
  178. if p3<9 then
  179. term.setCursorPos(1,tY-1)
  180. term.clearLine()
  181. term.write("Please Enter your Password into the field")
  182. term.setBackgroundColor(colours.white)
  183. term.setTextColor(colours.black)
  184. paintutils.drawLine(1,8,25,8)
  185. term.setCursorPos(1,8)
  186. pass=read("*")
  187. term.setBackgroundColor(colours.lightGrey)
  188. term.setTextColor(colours.white)
  189. term.setCursorPos(1,tY-2)
  190. term.clearLine()
  191. term.write("Working...")
  192. sleep(1)
  193. os.startTimer(1)
  194. term.setTextColor(colours.white)
  195. end --if p3>7
  196. end --if p3<9
  197. end --if p2>26
  198. end --if lion==false
  199. end --if e=="mouse_click"
  200.  
  201. end --while
  202. term.setBackgroundColor(colours.black)
  203. term.clear()
  204. term.setCursorPos(1,1)
  205. term.setTextColor(colours.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement