Guest User

new code

a guest
Mar 19th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. function main()
  2. if fs.exists("users/" .. rp2 .. "/" .. rp3) then
  3. if fs.exists("users/" .. rp3 .. "/privalege/superuser") then
  4. print(rp2, " found. sending admin login codes")
  5. rednet.broadcast(rp1)
  6. sleep(2)
  7. rednet.broadcast(rp2)
  8. sleep(2)
  9. rednet.broadcast(rp4)
  10. sleep(2)
  11. rednet.broadcast("superuser")
  12. print(rp2, ":", rp4, ":", "superuser:has logged in")
  13. elseif fs.exists("users/" .. rp2 .. "/" .. rp3) then
  14. print(rp2, " found. sending norm login codes")
  15. rednet.broadcast(rp1)
  16. sleep(2)
  17. rednet.broadcast(rp2)
  18. sleep(2)
  19. rednet.broadcast(rp4)
  20. sleep(2)
  21. rednet.broadcast("norm")
  22. print(rp2, ":", rp4, ":", "norm:has logged in")
  23. end
  24.  
  25. function ashutdown()
  26. print("shutting down")
  27. sleep(2)
  28. os.shutdown()
  29. end
  30.  
  31. print("Starting CraftOs Server Program By Alex_")
  32. print("which side is the modem?")
  33. modem=read()
  34. print("Admin password for session")
  35. apass=read()
  36. fs.delete("users/admin")
  37. fs.makeDir("users/admin")
  38. fs.makeDir("users/admin/" .. apass)
  39. fs.makeDir("users/admin/privalege")
  40. fs.makeDir("users/admin/privalege/superuser")
  41. print("password set with privalege superuser")
  42. sleep(1)
  43. rednet.open(modem)
  44. term.clear()
  45. term.setCursorPos(1,1)
  46. print("Server Started")
  47. print("Click CTRL For Console")
  48. print("===============================================")
  49. while true do
  50. print("scanning")
  51. from,rp1=rednet.receive(60)
  52. sleep(1)
  53. from,rp2=rednet.receive(60)
  54. sleep(1)
  55. from,rp3=rednet.receive(60)
  56. sleep(1)
  57. from,rp4=rednet.receive(60)
  58. sleep(1)
  59. if rp1=="login" then main()
  60. end
  61. end
  62.  
  63. end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment