mIRC Homepage
Posted By: RedDevilUK Kick list - 08/05/06 01:50 AM
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 frown 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 smile
any help would be great thanks
Posted By: schaefer31 Re: Kick list - 08/05/06 02:00 AM
/help on kick
/help /aline
Posted By: RedDevilUK Re: Kick list - 08/05/06 02:36 AM
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
Posted By: RedDevilUK Re: Kick list - 08/05/06 02:41 AM
is it possible to add the kick reason to the log?

cheers
Posted By: bwr30060 Re: Kick list - 08/05/06 03:46 AM
That would be $2 right? Just
Code:
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan for $2
Posted By: RedDevilUK Re: Kick list - 08/05/06 04:10 AM
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 smile dont worry im not kicking people out just to test this lol
Posted By: schaefer31 Re: Kick list - 08/05/06 04:13 AM
In your aline, the reason should be $1- and not $2-.
Posted By: RedDevilUK Re: Kick list - 08/05/06 04:21 AM
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
}

?
Posted By: schaefer31 Re: Kick list - 08/05/06 04:30 AM
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:

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
Posted By: RedDevilUK Re: Kick list - 08/05/06 04:44 AM
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 smile

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 smile

thanks schaefer31, your a star smile
Posted By: Damsulegna Re: Kick list - 08/05/06 05:37 AM
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)
Posted By: schaefer31 Re: Kick list - 08/05/06 05:53 AM
That is true if the directory contains spaces, but since I noticed from his post that there are none, I opted not to include " ".
Posted By: RedDevilUK Re: Kick list - 08/05/06 06:06 AM
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
Posted By: schaefer31 Re: Kick list - 08/05/06 06:24 AM
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)
Posted By: RedDevilUK Re: Kick list - 08/05/06 07:23 AM
Done

once again, thanks alot smile

You've been a great help.
Posted By: bwr30060 Re: Kick list - 08/05/06 12:19 PM
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.
Posted By: schaefer31 Re: Kick list - 08/05/06 12:23 PM
Quote:
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.


You must still be tired wink
Posted By: bwr30060 Re: Kick list - 08/05/06 12:24 PM
Yep grin Just got up this morning. It's 8:30 here. Got up about an hour ago.
Posted By: RedDevilUK Re: Kick list - 08/05/06 03:38 PM
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 smile
Posted By: RedDevilUK Re: Kick list - 09/05/06 06:54 PM
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
Posted By: bwr30060 Re: Kick list - 09/05/06 07:21 PM
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
Code:
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.
Posted By: schaefer31 Re: Kick list - 09/05/06 07:26 PM
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.
Posted By: DaveC Re: Kick list - 09/05/06 10:05 PM
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
© mIRC Discussion Forums