mIRC Home    About    Download    Register    News    Help

Print Thread
Showing specific user's history only #260898 01/07/17 03:48 PM
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.

Re: Showing specific user's history only [Re: DJQuad] #260899 01/07/17 04:39 PM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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 $+ *
}

Re: Showing specific user's history only [Re: ruprecht] #260924 04/07/17 03:55 PM
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.
Re: Showing specific user's history only [Re: DJQuad] #260925 04/07/17 04:30 PM
Joined: Sep 2005
Posts: 76
deVilbaT Offline
Babel fish
Offline
Babel fish
Joined: Sep 2005
Posts: 76
Should be in Remotes and restart not needed (Ok button only).

Last edited by deVilbaT; 04/07/17 04:31 PM.
Re: Showing specific user's history only [Re: DJQuad] #260932 06/07/17 12:44 PM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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.

Re: Showing specific user's history only [Re: ruprecht] #260941 06/07/17 05:18 PM
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?

Re: Showing specific user's history only [Re: DJQuad] #260947 07/07/17 08:55 AM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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 }
}

Re: Showing specific user's history only [Re: ruprecht] #260949 07/07/17 05:12 PM
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?

Re: Showing specific user's history only [Re: DJQuad] #260951 08/07/17 03:56 AM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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 
  }
}

Re: Showing specific user's history only [Re: ruprecht] #260954 08/07/17 04:15 PM
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!

Re: Showing specific user's history only [Re: DJQuad] #260975 10/07/17 10:52 AM
Joined: Aug 2016
Posts: 36
ruprecht Offline
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