I need help with a script and have been unable to solve it myself so I finally joined here to get some help.

I have a very simple script to log every time a user is kicked into a custom window so I can reference who was kicked and when.


on *:KICK:#: {
if (You have been kicked isin $1-) {
/echo @KICK $fulldate $knick was kicked from $chan by $nick reason: $1-

This works well when a user is kicked from one channel, but when a user is banned, they get kicked from all channels on the server and the script triggers for each individual kick and floods my window for each channel the person is kicked from.

Is there a good way to condense this so it will only trigger once, but the $chan will output all the channels the person was kicked from in one message? The user could be kicked from one channel or could be kicked from five and because of how the bans/kicks work there is sometimes a few seconds of delay from getting kicked from the first channel and getting kicked from the last channel.