Advertisement
TheOutcast5

Untitled

Dec 30th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function reg()
  2. shell.run('clear')
  3. shell.run('/.Firewolf_Data/servers/craft.net/back')
  4. term.setCursorPos(1,5)
  5. shell.run('mkdir', '.u')
  6. term.setTextColour(colours.white)
  7. centerPrint("Registration")
  8. print''
  9. print("  Username  ")
  10. term.setBackgroundColour(colours.grey)
  11. print("            ")
  12. term.setCursorPos(1,8)
  13. user = io.read()
  14. term.setBackgroundColour(colours.black)
  15. print''
  16. print("  Password  ")
  17. term.setBackgroundColour(colours.grey)
  18. print("            ")
  19. term.setCursorPos(1,11)
  20. pass = read('x')
  21. term.setBackgroundColour(colours.black)
  22. if not fs.exists('/.u/' ..user) then
  23. file = fs.open('/.u/' ..user, 'w')
  24. file.write(pass)
  25. file.close()
  26. print''
  27. print(" Registered ")
  28. sleep(.5)
  29. log()
  30. else
  31. print''
  32. Print("Already Registered")
  33. sleep(.5)
  34. reg()
  35. end
  36. end
  37. function log()
  38. shell.run('clear')
  39. shell.run('/.Firewolf_Data/servers/craftnet.net/back')
  40. term.setCursorPos(1,5)
  41. term.setTextColour(colours.white)
  42. centerPrint("Login")
  43. print''
  44. print("  Username  ")
  45. term.setBackgroundColour(colours.grey)
  46. print("            ")
  47. term.setCursorPos(1,8)
  48. user = io.read()
  49. term.setBackgroundColour(colours.black)
  50. print''
  51. print("  Password  ")
  52. term.setBackgroundColour(colours.grey)
  53. print("            ")
  54. term.setCursorPos(1,11)
  55. pass = read('x')
  56. term.setBackgroundColour(colours.black)
  57. if not fs.exists('/.u/' ..user) then
  58. print''
  59. print("  Bad Login ")
  60. sleep(.5)
  61. log()
  62. else
  63. local file = fs.open('/.u/' ..user, 'r')
  64. local sText = file.readAll()
  65. file.close()
  66. if sText == pass then
  67. print''
  68. print(user.. " Logging In")
  69. sleep(.5)
  70. home()
  71. else
  72. print''
  73. print("  Bad Login ")
  74. log()
  75. end
  76. end
  77. end
  78. function home()
  79. shell.run('clear')
  80. term.setBackgroundColour(colours.green)
  81. print("                                                   ")
  82. term.setBackgroundColour(colours.black)
  83. term.setTextColour(colours.grey)
  84. centerPrint("CraftNet Home")
  85. end
  86. if not fs.exists('/.Firewolf_Data/servers/craftnet.net/back') then
  87. file = fs.open('/.Firewolf_Data/servers/craftnet.net/back')
  88. file.write(term.setBackgroundColour(colours.green))
  89. file.write(print("                                                   "))
  90. file.write(term.setBackgroundColour(colours.black))
  91. file.write(term.setTextColour(colours.grey))
  92. file.write(centerPrint("CraftNet"))
  93. file.write(term.setCursorPos(1,17))
  94. file.write(term.setBackgroundColour(colours.green))
  95. file.write(print("                                                   "))
  96. file.close()
  97. if not fs.exists('/.u') then
  98. reg()
  99. else
  100. log()
  101. end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement