mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Kick list #148555 08/05/06 01:50 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148556 08/05/06 02:00 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
/help on kick
/help /aline

Re: Kick list #148557 08/05/06 02:36 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Last edited by RedDevilUK; 08/05/06 02:50 AM.
Re: Kick list #148558 08/05/06 02:41 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
is it possible to add the kick reason to the log?

cheers

Last edited by RedDevilUK; 08/05/06 02:49 AM.
Re: Kick list #148559 08/05/06 03:46 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
That would be $2 right? Just
Code:
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan for $2

Last edited by bwr30060; 08/05/06 03:48 AM.
Re: Kick list #148560 08/05/06 04:10 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148561 08/05/06 04:13 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
In your aline, the reason should be $1- and not $2-.

Re: Kick list #148562 08/05/06 04:21 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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
}

?

Last edited by RedDevilUK; 08/05/06 04:25 AM.
Re: Kick list #148563 08/05/06 04:30 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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

Re: Kick list #148564 08/05/06 04:44 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148565 08/05/06 05:37 AM
Joined: May 2003
Posts: 41
D
Damsulegna Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
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)


If At First You Don't Succeed, Ask Someone For Help......
Re: Kick list #148566 08/05/06 05:53 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
That is true if the directory contains spaces, but since I noticed from his post that there are none, I opted not to include " ".

Re: Kick list #148567 08/05/06 06:06 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148568 08/05/06 06:24 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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)

Re: Kick list #148569 08/05/06 07:23 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
Done

once again, thanks alot smile

You've been a great help.

Re: Kick list #148570 08/05/06 12:19 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

Re: Kick list #148571 08/05/06 12:23 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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

Re: Kick list #148572 08/05/06 12:24 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Yep grin Just got up this morning. It's 8:30 here. Got up about an hour ago.

Re: Kick list #148573 08/05/06 03:38 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148574 09/05/06 06:54 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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

Re: Kick list #148575 09/05/06 07:21 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

Re: Kick list #148576 09/05/06 07:26 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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.

Re: Kick list #148577 09/05/06 10:05 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Page 1 of 2 1 2