View Single Post
08-31-15, 02:10 AM   #2
Kkthnx
A Cobalt Mageweaver
 
Kkthnx's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2011
Posts: 247
Originally Posted by Lesteryoung View Post
I'm trying to create a command function that simply clears the chat that you currently have selected, whether it be the combat log or the main chat or any other chat frame.

This is what I have, but the code is off.

Code:
SlashCmdList["CLEAR"] = function() SELECTED_CHAT_FRAME() end
	SLASH_CLEAR1     = "/clear"
Try this.
Code:
SlashCmdList.CLEAR_CHAT = function()
	for i = 1, NUM_CHAT_WINDOWS do
		_G[format("ChatFrame%d", i)]:Clear()
	end
end
SLASH_CLEAR_CHAT1 = "/clear"
If you want to see some other ones look here.
https://github.com/Kkthnx/KkthnxUI/b...e/Commands.lua
__________________
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.

Last edited by Kkthnx : 08-31-15 at 02:12 AM.
  Reply With Quote