Guest User

Untitled

a guest
Oct 15th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. version = "0.1 Alpha"
  2. -- Alpha Is Company Employees only! --
  3. idsconnected = {}
  4. while true do
  5. id, msg = rednet.receive()
  6. if msg == "Logging in Chat realm" then
  7. validate = id
  8. id, msg = rednet.receive()
  9. if id = validate then
  10. validateusername = msg
  11. id, msg = rednet.receive()
  12. if id = validate then
  13. validatepassword = msg
  14. checkpassword = fs.open(validateusername, "r")
  15. correctpassword = checkpassword.readAll()
  16. checkpassword.close()
  17. if correctpassword == validatepassword then
  18. table.insert(idsconnected, id)
  19. userhat = validateusername .. "hat"
  20. hatfile = fs.open(userhat, "r")
  21. hat = hatfile.readAll()
  22. hatfile.close()
  23. for i=1, #idsconnected do
  24. rednet.send(idsconnected[1], "new user")
  25. end
  26. for i=1, #idsconnected do
  27. rednet.send(idsconnected[1], validateusername)
  28. end
  29. for i=1, #idsconnected do
  30. rednet.send(idsconnected[1], "hat:" )
  31. end
  32. for i=1, #idsconnected do
  33. rednet.send(idsconnected[1], hat)
  34. end
  35. for i=1, #idsconnected do
  36. rednet.send(idsconnected[1], hat)
  37. end end end
  38. else
  39. if table.contains(idsconnected, id) then
  40. for i=1, #idsconnected do
  41. rednet.send(idsconnected[i], msg)
Add Comment
Please, Sign In to add comment