View Single Post
08-01-18, 09:44 AM   #1
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 51
Talking Can someone fix this function?

hey guys, can someone fix this function?
ctrl + left click on chat frame to automatically report spammer
since 8.0, it's broken

Lua Code:
  1. -- Ctrl + left click to report spamer
  2. local _ChatFrame_OnHyperlinkShow = ChatFrame_OnHyperlinkShow;
  3. function ChatFrame_OnHyperlinkShow (chatframe,link,text,button)
  4.     if IsControlKeyDown() then
  5.         local line = string.match(link,"player:[^:]+:(%d+):");
  6.             if line then
  7.                 ReportPlayer("spam",line);
  8.             return;
  9.         end
  10.     end
  11.     return _ChatFrame_OnHyperlinkShow (chatframe,link,text,button);
  12. end



error detail

Lua Code:
  1. attempt to call global 'ReportPlayer' (a nil value)
  2. Count: 1
  3.  
  4. Call Stack:
  5. [C]: in function `ReportPlayer'
  6. in function `ChatFrame_OnHyperlinkShow'
  7. [string "*:OnHyperlinkClick"]:1: in function <[string "*:OnHyperlinkClick"]:1>
  Reply With Quote