mIRC Homepage
Posted By: DJQuad Showing specific user's history only - 01/07/17 03:48 PM
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.
Posted By: ruprecht Re: Showing specific user's history only - 01/07/17 04:39 PM
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 $+ *
}
Posted By: DJQuad Re: Showing specific user's history only - 04/07/17 03:55 PM
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.
Posted By: deVilbaT Re: Showing specific user's history only - 04/07/17 04:30 PM
Should be in Remotes and restart not needed (Ok button only).
Posted By: ruprecht Re: Showing specific user's history only - 06/07/17 12:44 PM
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.
Posted By: DJQuad Re: Showing specific user's history only - 06/07/17 05:18 PM
Thanks all. Is there a way to do this for log files as well?
Posted By: ruprecht Re: Showing specific user's history only - 07/07/17 08:55 AM
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 }
}
Posted By: DJQuad Re: Showing specific user's history only - 07/07/17 05:12 PM
On the .Log file line can I specify a specific log file?

Or better yet, the name of the [activetab].log?
Posted By: ruprecht Re: Showing specific user's history only - 08/07/17 03:56 AM
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 
  }
}
Posted By: DJQuad Re: Showing specific user's history only - 08/07/17 04:15 PM
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!
Posted By: ruprecht Re: Showing specific user's history only - 10/07/17 10:52 AM
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
© mIRC Discussion Forums