Thread: ChatGPT
View Single Post
01-23-23, 07:15 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Interesting, though this one has some issues. It's largely dependent on having active chatframes with the message event registered. If you have multiple chatframes with the same event registered, it will send duplicate replies for each one.
Lua Code:
  1. local function AutoReply(event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
  2.   if event == "CHAT_MSG_WHISPER" then
  3.     SendChatMessage("I'm busy", "WHISPER", nil, arg2)
  4.   end
  5. end
  6.  
  7. ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER", AutoReply)

Originally Posted by ChatGPT
You can run this script by typing the command /run AutoReply() in the chat window, or by binding it to a macro.
This will do nothing as the callback function is expecting various arguments from a chat event that it isn't getting.



Originally Posted by ChatGPT
You can run this script by typing the command /run AutoReply() in the chat window, or by binding it to a macro.
You can run this script by typing the command /run CheckPowerInfusion() in the chat window, or by binding it to a macro.
Revisiting the second and also in the third prompt, these functions are defined as locals. You can't even access them with /run.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote