This is a ban and kick logger that utilises seperate windows to show kicks and bans.
very useful if you are in high volume rooms with ops and have alot of kicks and bans.. if you go afk for extended time and come back .. you only need look in say @bans window to see what has happened when and then got to exact time on logs.
this loads up in a fresh new remotes window on your mirc. this was tested on mirc v6.35
when a @bans or @kicks window opens .. click it to view, then right click the tab itself .. @bans or @kicks then goto logging and turn on
then name the file and where it is to log.. and that is it done then :)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Cheiron's Kick and Ban logging system ;
; utilising 2 seperate custom windows ;
; for ease of viewing and log finding ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;first the event which in this case is an on ban
on *:ban:#:{
;open a new window on mirc. we will call it @bans
window @bans
;now to write the information in that window for easy later viewing using echo
echo -t @bans [ban logger] $nick set the following ban $1- against user $bnick on $time $date in $chan
;close the brackets at the end
}
;same here but this is the kick event
on *:kick:#:{
window @kicks
echo -t @kicks [kick tracker] $nick kicked $knick from $chan on $date at $time
}
I like simplicity, but simplicity isn't always revolved around a successful accomplishment due to the limitation of a mIRC identifier or a command. Thus we need to find another way or path to compensate that fallacy. Once you get the hing of a subject, it won't be as complicated as you think. In fact, you will see it as easy as pie.
You know what. We don't need the rawmode event after all:
on *:ban:#: bklog $1-
on *:kick:#: bklog
alias -l bklog {
window $iif($event == kick,@kicks,@bans)
if ($event == kick) {
echo -t @kicks [kick tracker] $nick kicked $knick from $chan on $date at $time
}
else {
var %b = 1
while ($ialchan($banmask,$chan,%b).nick) {
echo -t @bans [ban logger] $nick set the following ban $1- against the user $v1 on $time $date in $chan
inc %b
}
}
}
It was as simple as adding the $1- after the event parameter.
lol My mistake. I left it out thinking that was unimportant. Here is the fix:
on *:ban:#: bklog
on *:kick:#: bklog
on *:rawmode:#:if ($regex($1-,/([+][^\-]*b.+)/)) set %bset $regml(1)
alias -l bklog {
window $iif($event == kick,@kicks,@bans)
if ($event == kick) {
echo -t @kicks [kick tracker] $nick kicked $knick from $chan on $date at $time
}
else {
var %b = 1
while ($ialchan($banmask,$chan,%b).nick) {
echo -t @bans [ban logger] $nick set the following ban %bset against the user $v1 on $time $date in $chan
inc %b
}
unset %bset
}
}
initially .. the bot was showing with my code ..
[ban logger] Cheiron set the following ban +b Titan_Bot!@* against user on 19:10:05 23/05/2011 in #test
with your edit ..
[ban logger] Cheiron set the following ban against the user Titan_Bot on 21:12:58 23/05/2011 in #test
mine is missing the nick but has the ban ... yours has the nick but is missing the ban
Cheiron, use
$ial($banmask,$chan,0).nick
in conjunction with a while loop. This will always return the correct banned nickname if a ban mask doesn't contain the nickname. This is my approach toward what your code should have been become of:
on *:ban:#: bklog
on *:kick:#: bklog
alias -l bklog {
window $iif($event == kick,@kicks,@bans)
if ($event == kick) {
echo -t @kicks [kick tracker] $nick kicked $knick from $chan on $date at $time
}
else {
var %b = 1
while ($ialchan($banmask,$chan,%b).nick) {
echo -t @bans [ban logger] $nick set the following ban against the user $v1 on $time $date in $chan
inc %b
}
}
}
Why did you use echo?
he's using /echo -t; /aline doesn't have a -t switch. there are also a couple of side effects of using /echo that are desirable in a script such as this: the window label changes to the 'event' colour indicating to the user that information has been added, and the line can potentially be logged to a file if the user chooses to log the window. just because /aline can only be used with a custom window does not mean a custom @window should only ever use /aline.
That way, it actually takes less CPU.
this is baseless nonsense.
Why did you use echo?
echo -t @kicks [kick tracker] $nick kicked $knick from $chan on $date at $time
echo -t @bans [ban logger] $nick set the following ban $1- against user $bnick on $time $date in $chan
You should use aline, as well as use $& to simplify the code:
aline @kicks [kick tracker] $nick kicked $knick $&
from $chan on $date at $time
aline @bans [ban logger] $nick set the following $&
ban $1- against user $bnick on $time $date in $chan
That way, it actually takes less CPU.
updated .. script now utilises seperate windows from the original self pm method.
updated .. seperate windows for kick and ban to avoid confusion when checking
updated .. made code easier to understand for newcomers to scripting with subnotes embedded
to do list - need help to get the @windows to log so can retrieve from logs using this format writeini -n logbans.txt / writeini -n logkicks.txt
thanks for the tips folks and look forward to the new reviews
ty SpotRedDog. the script runs nice and stable from mIRC6.16 to the new mIRC6.31. i been using it for ages and have had no issues. only thing to watch with it, is if you have a pm blocker as theoritically you are receiving a pm from your own script and ergo the pm blocker will stop it. just remember to add your own nick to the pm bypass to allow it to run if this is the case.
Cheiron