Thread Tools Display Modes
09-02-15, 08:00 PM   #21
A Cobalt Mageweaver
Kkthnx's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2011
Posts: 247
Originally Posted by Lesteryoung View Post
Thanks kkThnx, the one you posted works the same as Munk's code basically. It clears selected windows without clearing all windows.

For some reason, it clears the combat log fine, but if you tab between the combat log views (What happened to me?) thing it repopulates the data you previously cleared. If this is unavoidable then it's fine, mainly just wanted to clear chat anyway.
Yah, now we can all thank Phanx as usual! Phanx has some pretty neat ways of coding things. You could learn a couple things.
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.
  Reply With Quote
09-03-15, 06:48 AM   #22
A Pyroguard Emberseer
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
Originally Posted by Seerah View Post
that was Petrah's that he had quoted
Just to clarify, that's not my code. I got it from someone who shared it a very very long time ago on the official forums.
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8. now loaded!", please add an option to disable it!
  Reply With Quote
09-03-15, 09:39 AM   #23
A Molten Giant
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
The combat log entries are not stored in the message frame, so to speak, so it can be repopulated again. There seems to be a function CombatLogClearEntries() which sounds like it might do what you want.
Grab your sword and fight the Horde!
  Reply With Quote
12-06-23, 07:26 AM   #24
A Kobold Labourer
Join Date: Dec 2023
Posts: 1
Originally Posted by Kkthnx View Post
Here you go

SLASH_CLEARCHAT2 = "/clearchat"

SlashCmdList.CLEARCHAT = function(cmd)
	cmd = cmd and strtrim(strlower(cmd))
	for i = 1, NUM_CHAT_WINDOWS do
		local f = _G["ChatFrame"..i]
		if f:IsVisible() or cmd == "all" then
I tested this window by window and this is what you are looking for 100%

Credits to Phanx / PhanxChat

How do you actually implement and use this in the game?
  Reply With Quote
12-06-23, 08:06 AM   #25
I did that?
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,831
Copy/paste the code to this website to create/download as an addon like any other. Add it to your AddOns folder and login (or /reload).

Type /clear (or /clearchat) in-game to use.
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-06-23 at 08:58 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Clear chat slash command.

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