Advertisement
Xzempt

Untitled

Jul 22nd, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. if not awayFrame then
  2.     awayFrame = CreateFrame("Frame")
  3.  
  4. end
  5.  local frame = awayFrame
  6.  frame:RegisterEvent("CHAT_MSG_SYSTEM")
  7.  frame:SetScript("OnEvent", function(self, event, ...)
  8.        local system_msg = select(1, ...)
  9.        if (system_msg:find("You are now Away: Away") ~= nil) then
  10.        Logout()
  11.        end
  12.        if (system_msg:find("%u:%s%d(.*).%d(.*)%s%u%l%l%l%s") ~= nil) and (spammed[1] == "on") then
  13.           local found = string.sub(system_msg, string.find(system_msg, "%u:%s%d(.*).%d(.*)%s%u%l%l%l%s", 2))
  14.           ipsysmsg = string.sub(found, string.find(found, "%d(.*).(.*).(.*).(.*)%d"))
  15.           spammed = { "off" }
  16.           outSAY(".ban ip " ..ipsysmsg.. " 1s Advertising")
  17.           print(ipsysmsg)
  18.     end
  19. end)
  20.  
  21.  
  22. if not ipFrame then
  23.     spamFrame = CreateFrame("Frame")
  24.  end
  25.  local frame = spamFrame
  26.  frame:RegisterEvent("CHAT_MSG_SAY")
  27.  frame:SetScript("OnEvent", function(self, event, ...)
  28.        local spam_msg = select(1, ...)
  29.        if (spam_msg:find("elf(.*)wow(.*)com") ~= nil) then
  30.           local found = arg1
  31.           spammed = { "on" }
  32.           outSAY(".pinfo " ..arg2)
  33.           outSAY(".ban char " ..arg2.. " 1s Advertising")
  34. print(found)
  35. print(arg2)
  36. SendChatMessage("Elf-wow spam detected, will proceedd to ban function as planned! Banning " ..arg2, "SAY")
  37.        end
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement