Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- errPages.blacklistRedirectionBots = function()
- local suspected = {}
- local alphabet = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
- "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "."}
- local name = ""
- for i = 1, math.random(1,3) do
- name = ""
- for d = 1, math.random(6, 17) do
- name = name .. alphabet[math.random(1, 27)]
- end
- rednet.broadcast(name)
- sleep(timeout)
- end
- for i = 1, 4 do
- name = ""
- for d = 1, math.random(6, 17) do
- name = name .. alphabet[math.random(1, 27)]
- end
- local finishCheck = false
- rednet.broadcast(name)
- clock = os.clock()
- for i = 1, 5 do
- while os.clock() - clock < timeout do
- local id = rednet.receive(timeout)
- if id ~= nil and not(verify("blacklist", id)) then
- name = ""
- for d = 1, math.random(6, 17) do
- name = name .. alphabet[math.random(1, 27)]
- end
- local inSuspected = false
- for b = 1, #suspected do
- if suspected[b][1] == id then
- suspected[b][2] = suspected[b][2] + 1
- inSuspected = true
- end
- end
- if not(inSuspected) then
- table.insert(suspected, {id, 1})
- break
- end
- elseif id == nil then
- finishCheck = true
- break
- end
- end
- if finishCheck then break end
- end
- if finishCheck then break end
- end
- for i = 1, #suspected do
- if suspected[i][2] > 2 then
- local f = io.open(userBlacklist, "a")
- f:write(tostring(suspected[i][1]) .. "\n")
- f:close()
- table.insert(blacklist, tostring(suspected[i][1]))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment