mIRC Home    About    Download    Register    News    Help

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

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

#148557 08/05/06 02:36 AM
Joined: May 2006
Posts: 32
R
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.
#148558 08/05/06 02:41 AM
Joined: May 2006
Posts: 32
R
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.
#148559 08/05/06 03:46 AM
Joined: May 2005
Posts: 449
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.
#148560 08/05/06 04:10 AM
Joined: May 2006
Posts: 32
R
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

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

#148562 08/05/06 04:21 AM
Joined: May 2006
Posts: 32
R
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.
#148563 08/05/06 04:30 AM
Joined: Aug 2005
Posts: 525
S
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

#148564 08/05/06 04:44 AM
Joined: May 2006
Posts: 32
R
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

#148565 08/05/06 05:37 AM
Joined: May 2003
Posts: 41
D
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......
#148566 08/05/06 05:53 AM
Joined: Aug 2005
Posts: 525
S
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 " ".

#148567 08/05/06 06:06 AM
Joined: May 2006
Posts: 32
R
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

#148568 08/05/06 06:24 AM
Joined: Aug 2005
Posts: 525
S
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)

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

once again, thanks alot smile

You've been a great help.

#148570 08/05/06 12:19 PM
Joined: May 2005
Posts: 449
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.

#148571 08/05/06 12:23 PM
Joined: Aug 2005
Posts: 525
S
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

#148572 08/05/06 12:24 PM
Joined: May 2005
Posts: 449
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.

#148573 08/05/06 03:38 PM
Joined: May 2006
Posts: 32
R
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

#148574 09/05/06 06:54 PM
Joined: May 2006
Posts: 32
R
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

Page 1 of 2 1 2

Link Copied to Clipboard