Snippets
  • Uploaded By: entropy
  • Added: 2 years ago
  • Updated: 2 years ago
  • mIRC Version: 7.52+
  • Hits: 653
  • Size: 2.79KB
  • Downloads: 26
  • Review By: entropy



Simple Seen v1.6

This snippet stores data for each nick and returns it with the !seen command.
Screenshot...

  
  4    0  Login to Vote.


Source Code:
  1. ; Simple Seen v1.6 - by entropy 2017
  2. ; Usage: !seen <nick>
  3.  
  4. on *:start:{ .timerseen -o 0 300 saveall }
  5. on *:exit:{ saveall }
  6. on *:disconnect:{ if ($hget($+(seen.,$network))) { hsave -o $+(seen.,$network) $qt($+($scriptdir,seen.,$network,.dat)) | hfree $+(seen.,$network) } }
  7.  
  8. on *:connect:{
  9. if (!$hget($+(seen.,$network))) { hmake $+(seen.,$network) 100 }
  10. if ($exists($qt($+($scriptdir,seen.,$network,.dat)))) { hload $+(seen.,$network) $qt($+($scriptdir,seen.,$network,.dat)) }
  11. }
  12.  
  13. alias -l saveall { var %a = 1, %b | while ($scon(%a)) { %b = $v1 | scid %b | if ($hget($+(seen.,$network))) { hsave -o $+(seen.,$network) $qt($+($scriptdir,seen.,$network,.dat)) } | inc %a } }
  14. alias -l clearall { var %a = 1, %b | while ($scon(%a)) { %b = $v1 | scid %b | if ($hget($+(seen.,$network))) { hfree $+(seen.,$network) | hmake $+(seen.,$network) 100 } | inc %a } }
  15.  
  16. #seen on
  17. on *:text:*:#:{
  18. hadd -m $+(seen.,$network) $nick $fulladdress $ctime Messaging # with text: $qt($1-)
  19. if (?seen iswm $1 && $left($1,1) isin @!. && $2) { .timerdoseen -o 1 2 seenx # $2- }
  20. }
  21. on *:input:#:{
  22. hadd -m $+(seen.,$network) $me $address($me,5) $ctime Messaging # with text: $qt($1-)
  23. if (?seen iswm $1 && $left($1,1) isin @!. && $2) { .timerdoseen -o 1 2 seenx # $2- }
  24. }
  25.  
  26. on *:action:*:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Actioning # with text: $qt($1-) }
  27. on *:join:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Joining # }
  28. on *:part:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Parting # with text: $qt($1-) }
  29. on *:rawmode:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Setting # mode(s) to: $qt($1-) }
  30. on *:kick:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Kicking $knick out of # with text: $qt($1-) }
  31. on *:quit:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Quitting IRC with text: $qt($1-) }
  32. on *:topic:#:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Setting # topic to: $qt($1-) }
  33. on *:nick:{ hadd -m $+(seen.,$network) $nick $fulladdress $ctime Changing nickname to: $newnick }
  34.  
  35. alias seenx {
  36. var %a = $2
  37. var %b = $hget($+(seen.,$network),$2)
  38. var %q = $hfind($+(seen.,$network),$2,1).item
  39. var %time = $asctime($gettok($hget($+(seen.,$network),%a),2,32))
  40.  
  41. var %nt = $gettok($hget($+(seen.,$network),%a),2,32)
  42. var %dur = $calc($ctime - %nt)
  43. var %dur = $replace($duration(%dur),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s) ago
  44.  
  45. var %rsn = $gettok($hget($+(seen.,$network),%a),3-,32)
  46. var %no = $gettok(%a,1,33)
  47. var %mo = $gettok($gettok(%b,1,32),2,33)
  48.  
  49. if (%b) { msg $1 [Seen] $chr(9679) I Last Saw $qt(%q) $iif(%mo,$+($chr(40),%mo,$chr(41))) %time $+($chr(40),%dur,$chr(41)) - %rsn }
  50. else { msg $1 [Seen] $chr(9679) I have not seen that person. }
  51. }
  52. #seen end


Comments (1)
November 27th, 2018 - By: hornest
Weird that it also works with ".seen"
I would like to see wildcard usage with it.
Like !seen nick*
Regards

Login to Comment.