Stary2001

Untitled

Jan 3rd, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. errPages.blacklistRedirectionBots = function()
  2. local suspected = {}
  3. local alphabet = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
  4. "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "."}
  5. local name = ""
  6. for i = 1, math.random(1,3) do
  7. name = ""
  8. for d = 1, math.random(6, 17) do
  9. name = name .. alphabet[math.random(1, 27)]
  10. end
  11. rednet.broadcast(name)
  12. sleep(timeout)
  13. end
  14.  
  15. for i = 1, 4 do
  16. name = ""
  17. for d = 1, math.random(6, 17) do
  18. name = name .. alphabet[math.random(1, 27)]
  19. end
  20.  
  21. local finishCheck = false
  22. rednet.broadcast(name)
  23. clock = os.clock()
  24. for i = 1, 5 do
  25. while os.clock() - clock < timeout do
  26. local id = rednet.receive(timeout)
  27. if id ~= nil and not(verify("blacklist", id)) then
  28. name = ""
  29. for d = 1, math.random(6, 17) do
  30. name = name .. alphabet[math.random(1, 27)]
  31. end
  32.  
  33. local inSuspected = false
  34. for b = 1, #suspected do
  35. if suspected[b][1] == id then
  36. suspected[b][2] = suspected[b][2] + 1
  37. inSuspected = true
  38. end
  39. end
  40.  
  41. if not(inSuspected) then
  42. table.insert(suspected, {id, 1})
  43. break
  44. end
  45. elseif id == nil then
  46. finishCheck = true
  47. break
  48. end
  49. end
  50. if finishCheck then break end
  51. end
  52. if finishCheck then break end
  53. end
  54.  
  55. for i = 1, #suspected do
  56. if suspected[i][2] > 2 then
  57. local f = io.open(userBlacklist, "a")
  58. f:write(tostring(suspected[i][1]) .. "\n")
  59. f:close()
  60. table.insert(blacklist, tostring(suspected[i][1]))
  61. end
  62. end
  63. end
Advertisement
Add Comment
Please, Sign In to add comment