|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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 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
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
/help on kick /help /aline
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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.
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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.
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
Fjord artisan
Joined: May 2005
Posts: 449 |
That would be $2 right? Just
/aline @kicked [[ $+ $time(hh:nn) $+ ]] $nick kicked $knick on channel $chan for $2
Last edited by bwr30060; 08/05/06 03:48 AM.
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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 dont worry im not kicking people out just to test this lol
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
In your aline, the reason should be $1- and not $2-.
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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.
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
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: 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
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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 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
|
|
|
|
Joined: May 2003
Posts: 41
Ameglian cow
|
Ameglian cow
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......
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
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 " ".
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
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)
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
Joined: May 2006
Posts: 32 |
Done once again, thanks alot You've been a great help.
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
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.
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
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
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
Fjord artisan
Joined: May 2005
Posts: 449 |
Yep Just got up this morning. It's 8:30 here. Got up about an hour ago.
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: May 2006
Posts: 32
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
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
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.
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
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
|
|
|
|
|