Hi i run 2 channels and have the usual idiots trying to spoil things....
is there a way of creating a script that just logs the kicks?
with the nick and dns info.... creating a file called kicked.txt?
ive been trying to do this myself.... but im having problems.
firstly i cant seem to get the info appearing in the new window ive created "@kicked"
then theres the log file thing??
as some of you will know the bots on quakenet dont store logs
so i would need a log creating in case i get disconnected or whatever.
plus i then have the abiilty to look back on who been kicked way to many times
any help would be great thanks
/help on kick
/help /aline
ok
on *:KICK:#:{
/window @kicked
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan
}
that works OK and after the window opened i chose logging
and i also added
on 1:CONNECT:/window @kicked
at the start of my script.ini
thanks
is it possible to add the kick reason to the log?
cheers
That would be $2 right? Just
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan for $2
cheers bwr30060 seems so obvious now lol
but i seem to be having a probem with the log file?
all i get in the log is
Session Start: Mon May 08 04:40:24 2006
Session Ident: @kicked
[04:40] * @kicked is being logged
and nothing else??? even though the @kicked window has 5 kicks in
5 kicks i did for the experiment
dont worry im not kicking people out just to test this lol
In your aline, the reason should be $1- and not $2-.
in the @kicked window ive got this
[05:17] RedDevilUK kicked Tombraider on channel #shelly for no Clones allowed
[05:17] RedDevilUK kicked Tombraider on channel #shelly for Stop arguing!!
still nothing in the log file either
on *:KICK:#:{
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan for $1-
/write C:\Mirc\logs\kicked.txt
}
?
There's a couple of problems with your code.
1.Tthe reason is $1- (note the dash at the end) and not $1.
2. In your write command, you don't specify any text to be written to the file.
That being said, here is an optimized version of your code:
on *:KICK:#:{
[color:blue]; If the @window is not open, open it
; With this line included, you can remove the window command for on CONNECT[/color]
if (!$window(@kicked)) window @kicked
aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick from $chan for $1-
[color:blue]; Writes the last (newest) line in your @window to the text file[/color]
write $logdirkicked.txt $line(@kicked,$line(@kicked,0))
}
BTW, $logdirkicked.txt is not a typo. There is no \ required when using directory identifiers. If you try
//echo -a $logdirkicked.txt you will see that it returns C:\path\to\mIRC\logs\kicked.txt
the reason is $1- (note the dash at the end) and not $1.
yea i realised that when it returned abreviated results lol
then went back and edited my post... the same time you re posted.
pasted your code in, works great cheers
ok now i can find the trouble causers.... see with there being several OPs we can all kick a guy and think hes on his first warning....
Not anymore
thanks schaefer31, your a star
might i suggest using
write $+(",$logdirkicked.txt,") $line(@kicked,$line(@kicked,0))
I wrote something similar and have mircdir in Program Files,
without $+(",$logdirkicked.txt,") it will just write a file called "C:\Program" on the C:\ drive. (Spaces in path)
That is true if the directory contains spaces, but since I noticed from his post that there are none, I opted not to include " ".
i understand.... it work fine though
all i need now is a DNS reply, because it is possible i could kick a nick 3 times and it be 3 different people?
without the dns you would never know?
Ummm
I think it would be easiest to add the user's address to the @window, since dns'ing the user may not always yield a result. That is besides the fact that many people have masked addresses. Just add this in somewhere:
$gettok($address($knick,2),2,64)
Done
once again, thanks alot
You've been a great help.
Sorry about the $2 $2- thing. I was tired last night and realized after I went to bed that it should have been $2-. Glad you got it working though.
Yep
Just got up this morning. It's 8:30 here. Got up about an hour ago.
Just in case anyone wants to do the same.. here is the finished scripts, with all changes added
on *:KICK:#:{
if (!$window(@kicked)) window @kicked
aline @kicked [[ $fulldate ]] - $gettok($address($knick,2),2,64) - $nick - kicked - $knick - from $chan for - $1-
write $+(",$logdirkicked.txt,") $line(@kicked,$line(@kicked,0))
}
good luck
Is there any way of tidying up the txt file that is made by this scripts??
it is difficult to read as there is no straight columns
if you know what i mean?
any help would be appreciated
You could just align it in columns without writing a full sentence. Separate it all by tabs so that the first column is the person who kicked, the second column is the person who got kicked, and third is the reason. You could just make a variable like this
var %kickline = $nick $+ $chr(9) $+ $knick $+ $1-
Then you could just write %kickline to your file. Note: you might want to space it out more if nick lengths are too long. Just add another $+ $chr(9) there.
Yes, it is to a certain extent but I don't think it's worth the trouble since a lot of the data being written to it has no upper limit to the length. It would be difficult to keep things aligned properly.
If you are familiar wtih html you could make an alias that when called it uses the text file to generate an html document with a table containing the various pieces of information.
on *:KICK:#:{
if (!$window(@kicked)) window @kicked
aline @kicked [[ $fulldate ]] - $gettok($address($knick,2),2,64) - $nick - kicked - $knick - from $chan for - $1-
write $+(",$logdirkicked.txt,") $line(@kicked,$line(@kicked,0))
write $+(",$logdirkicked.doc,") $+($fulldate,$chr(9),$gettok($address($knick,2),2,64),$chr(9),$nick,$chr(9),$knick,$chr(9),$chan,$chr(9),$1-)
}
open the doc file in what ever word processor you got and set the tab stops
* be aware that saving into the same file well likely add characters or control codes that would make adding extra lines problem matic at best.
* I suggest you save the file if need be to a new filename once setting the tabs