Quantcast Can someone fix this function? - WoWInterface
Thread Tools Display Modes
08-01-18, 09:44 AM   #1
devilArt
A Cyclonian
 
devilArt's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
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
08-01-18, 09:56 AM   #2
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 101
I think ReportPlayer was moved so I would guess that you need to call C_ChatInfo.ReportPlayer instead.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Can someone fix this function?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off