mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2017
Posts: 10
D
DJQuad Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2017
Posts: 10
Hi all, is there a way to see someone's chat history only? Another IRC client had a nice feature that when a nickname's chat was double clicked it would show their history.

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
I use this bit of code:
Code:
menu nicklist {
  -
  Search...: search # $1
}
menu channel {
  -
  Search...: search # $?="Search for:"
}
alias search {
  window -k0z @SearchResult -1 -1 1200 800
  var %fi = $replace($2-,$chr(32),*)
  filter -wwcp $1 @SearchResult * $+ %fi $+ *
}

Joined: Jul 2017
Posts: 10
D
DJQuad Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2017
Posts: 10
Thanks. Where do I put this code?

Edit: I put it at the end of popups but after restarting mirc I don't see any way to get it working.

Last edited by DJQuad; 04/07/17 04:05 PM.
Joined: Sep 2005
Posts: 116
Vogon poet
Offline
Vogon poet
Joined: Sep 2005
Posts: 116
Should be in Remotes and restart not needed (Ok button only).

Last edited by deVilbaT; 04/07/17 04:31 PM.

when no one watching us
we are invisible
Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
Yes put in remotes. Either make a new file, or use a sandbox remote file for all little code snippets like this.

To use it, you right click a nickname or channel window and look for the Search... menu option.

The nick menu option will search for all lines in a channel containing that nick, even other users who have typed it.

The channel menu option will ask you to enter a word or phrase to search for.

Joined: Jul 2017
Posts: 10
D
DJQuad Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2017
Posts: 10
Thanks all. Is there a way to do this for log files as well?

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
Sure can with a couple of extra lines...
Code:
menu nicklist {
  -
  Search
  .#: search # $1
  .Log file...: search @file $1
}
menu channel {
  -
  Search
  .#: search # $?="Search key:"
  .Log file...: search @file $?="Search key:"
}
alias search {
  window -k0z @SearchResult -1 -1 $calc($window(-2).w * .75) $calc($window(-2).h * .75)
  var %fi = * $+ $replace($2-,$chr(32),*) $+ *
  if $1 == @file { 
    var %fn = " $+ $sfile(*.log) $+ "
    if $isfile(%fn) { filter -fwcp %fn @SearchResult %fi }
  }
  else { filter -wwcp $1 @SearchResult %fi }
}

Joined: Jul 2017
Posts: 10
D
DJQuad Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2017
Posts: 10
On the .Log file line can I specify a specific log file?

Or better yet, the name of the [activetab].log?

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
This is turning in to a serious script =)

Revised version will give you a right click nick and channel menu option to search in the channel buffer or log file. The channel menu also has the option to search in any file.

Code:
menu nicklist {
  -
  Search
  .#: search # $1
  .# log: search @log # $1
}
menu channel {
  -
  Search
  .#: search # $?="Search key:"
  .# log:  search @log # $?="Search key:"
  .Any file...: search @any $?="Search key:"
}
alias search {
  window -k0z @SearchResult -1 -1 $calc($window(-2).w * .75) $calc($window(-2).h * .75)

  if $1 == @log { 
    var %fi = * $+ $replace($3-,$chr(32),*) $+ *
    var %fn = " $+ $readini($mircdir $+ mirc.ini,n,dirs,logdir) $+ $mklogfn($2) $+ "
    if $isfile(%fn) { filter -fwcp %fn @SearchResult %fi }
  }
  elseif $1 == @any { 
    var %fi = * $+ $replace($2-,$chr(32),*) $+ *
    var %fn = " $+ $sfile(*.log) $+ "
    if $isfile(%fn) { filter -fwcp %fn @SearchResult %fi }
  }
  else { 
    var %fi = * $+ $replace($2-,$chr(32),*) $+ *
    filter -wwcp $1 @SearchResult %fi 
  }
}

Joined: Jul 2017
Posts: 10
D
DJQuad Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2017
Posts: 10
That is glorious. smile Thank you! Just as an aside, I'll probably end up searching the log file every time since that would include the channel buffer as well.

Thanks again!

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
Good point about the log/channel buffer. Easy enough to mod the menus to your liking if you want to remove the channel search option smile


Link Copied to Clipboard