WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Can someone fix this function? (https://www.wowinterface.com/forums/showthread.php?t=56482)

devilArt 08-01-18 09:44 AM

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>

MuffinManKen 08-01-18 09:56 AM

I think ReportPlayer was moved so I would guess that you need to call C_ChatInfo.ReportPlayer instead.


All times are GMT -6. The time now is 08:10 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI