mIRC Home    About    Download    Register    News    Help

Print Thread
#20915 25/04/03 10:09 PM
Joined: Apr 2003
Posts: 13
P
pilot1 Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Apr 2003
Posts: 13
Is there any way I can have a script log everything in all PMs and channels to a different folder than mIRC logs them to?

Someone else using this computer keeps editing the logs in my normal mIRC logs folder (and they an easily check under options to see where i've moved it to), so i'd like to have a way to have a copy of unaltered logs in another folder.

Just use C:\Windows\ML for an example folder to put them in.
Thanks!

#20916 25/04/03 11:54 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Assuming the other person on the computer won't check the remote files, this should work... It also organizes files by day...

Code:
; change this to directory of log
alias logfolder { return C:\Windows\ML\ }
alias logfile { return $+($logfolder,$1,_,$asctime(mm-dd-yy)) }

; Actions
on *:ACTION:#: { /write $logfile($chan) $timestamp * $nick $strip($1-, burc) }
on *:ACTION:?: { /write $logfile($nick) $timestamp * $nick $strip($1-, burc) }

; Your Own Text
on *:INPUT:#: {
  /write $logfile($chan) $timestamp $+(<,$me,>) $strip($1-, burc)
}
on *:INPUT:?: {
  /write $logfile($active) $timestamp $+(<,$me,>) $strip($1-, burc)
}

; Joins
on *:JOIN:#: {
  if ($nick == $me) {
    /write $logfile($chan) $chr(32)
    /write $logfile($chan) $str(-, 50)
    /write $logfile($chan) Session Start $chan $+ : $fulldate
    /write $logfile($chan) $str(-, 50)
  }
  else /write $logfile($chan) $timestamp JOIN: $nick ( $+ $address($nick, 1) $+ )
}

; Kicks
on *:KICK:#: {
  /write $logfile($chan) $timestamp KICK: $nick Kicked $knick ( $+ $strip($1-,burc) $+ )
}

; Modes
on *:MODE:#: {
  /write $logfile($chan) $timestamp MODE: $1-
}

; Parts
on 1:PART:#: {
  if ($nick == $me) {
    /write $logfile($chan) $chr(32)
    /write $logfile($chan) $str(-, 50)
    /write $logfile($chan) Session End $chan $+ : $fulldate
    /write $logfile($chan) $str(-, 50)
  }
  else /write $logfile($chan) $timestamp PART: $nick ( $+ $address($nick, 1) $+ )
}

; Text
on *:TEXT:*:#: {
  /write $logfile($chan) $timestamp $+(<,$nick,>) $strip($1-, burc)
}
on *:TEXT:*:?: {
  /write $logfile($nick) $timestamp $+(<,$nick,>) $strip($1-, burc)
}


-KingTomato
#20917 26/04/03 02:47 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Code:
on *:exit:{
  ; This line will only copy the logs if the user is [color:blue]listed here[/color]
  if $me !isin [color:blue]pilot1 pilot2[/color] { return }
 
[color:green]  ; Just to ensure the directory exists[/color]
  if !$isdir(C:\Windows\ML\) { mkdir C:\Windows | mkdir C:\Windows\ML\ }
 
  !.echo -q $findfile($logdir,$+(*.,$date(yyyymmdd),.log),0,copy -o $+(",$1-," "C:\Windows\ML\,$remove($1-,$logdir,\),"))
}



[edit]Err whoops, I forgot to say that this will work if you date your logfiles smile[/edit]
[edit2]Added check for users nick[/edit2]

Last edited by Nimue; 26/04/03 03:07 AM.
#20918 26/04/03 11:52 AM
Joined: Apr 2003
Posts: 13
P
pilot1 Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Apr 2003
Posts: 13
Thanks guys!
It'll work to put that in a .mrc file and then load the file with /load -rs file.mrc, right?

#20919 26/04/03 09:47 PM
Joined: Apr 2003
Posts: 13
P
pilot1 Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Apr 2003
Posts: 13
It won't work...
I tried it, with the folder C:\Windows\templates and the mrc script loaded fine, but when I look in that folder nothing is there.
Any ideas?

Nimue, that wouldn't work cause he's editing them when mIRC is open - and that copies them when you exit it. smirk

#20920 27/04/03 10:02 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
on those first two action, I forgot the other parameter.. Make them both on *:ACTION:[color:green]*:<#|?>: {[/color]

Basically, ad the green portion to both.


-KingTomato
#20921 28/04/03 11:39 AM
Joined: Apr 2003
Posts: 13
P
pilot1 Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Apr 2003
Posts: 13
Thanks, it works now.


Link Copied to Clipboard