mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2007
Posts: 37
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jun 2007
Posts: 37
Hi, is there any script to log bans and kicks that happened in a channel, because I op in a channel and have had alot of complaints about bans and kicks being placed for no reason, is there anything that can log these for me with the name that places them, or the best you can do please! It's just I have alot of logs and it would take too much time to go through them all each day looking for bans

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Code:
on *:BAN:#: {
  write kbans.txt $timestamp $nick banned $banmask on #
  write kbans.txt -
}
on *:KICK:#: {
  write kbans.txt $timestamp $nick kicked $knick from # with reason: $1-
  write kbans.txt -
}

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Additionally, you can add the $bnick identifier to the information written for the ON BAN event, however, if you're going to do so, note that the $bnick identifier isn't always filled, depending on the format of the /ban command that is used to place the ban.


Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Originally Posted By: RusselB


note that the $bnick identifier isn't always filled



That's why I don't use it, because it's usually not filled.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
But you could cycle the ial to grab all nicks affected by that ban. smile (Assuming that the ban precedes a possible kick in a kickban situation - but that applies to aprox. 90% of instances)

Code:
on *:BAN:#: {

  var %x = 1, %banned
  while ($ialchan($banmask,#,%x).pnick) { var %banned = $addtok(%banned,$ifmatch,32) | inc %x }

  write kbans.txt $timestamp $nick banned $banmask on # $iif((%banned),affecting: %banned)
  write kbans.txt -
}


If you remove the ".pnick" property in the while statement, it will grab and write not the pnicks but the full addresses of users affected by the ban. On the other hand side, this will cause a much longer line, and, if a ban matches a LOT users, increase the risk of a "line too long error".

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Here is what I use. I don't log it to a file, though you could easily adjust it to do so. The custom window makes it very easy to quickly see who banned whom.

Code:
on *:ban:#yourchannel: {
  window -nk0 @Kicks/Bans
  aline -p @Kicks/Bans 09 $+ $nick banned09 $banmask in $chan at $time(hh:nn tt) on $date(mm/dd/yyyy)
}

on *:unban:#yourchannel: {
  window -nk0 @Kicks/Bans
  aline -p @Kicks/Bans 09 $+ $nick unbanned09 $banmask in $chan at $time(hh:nn tt) on $date(mm/dd/yyyy)
}

on *:kick:#yourchannel: { 
  window -nk0 @Kicks/Bans
  aline -p @Kicks/Bans 09 $+ $nick kicked09 $knick from $chan at $time(hh:nn tt) on $date(mm/dd/yyyy) for $1-
}


Change the 3 occurences of #yourchannel to your channel's name, or a group of channels, or else just # for all channels.

Obviously, you can also add $network and adjust colors/formatting as needed. Or, use one of the scripts posted above. This is just the one I made for myself.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard