Simple Seen System

By tye on Oct 02, 2003

Keeps track of the last time you saw a user.

; Paste into remotes.
; After you have pasted and saved either restart mIRC or type
; '/hmake seen 100' into your status window.
;
; Usage: /seen nick
; other users can type: !seen nick
;
; Tye @ DALnet/UnderNet (tye at mirc.net)
ON *:START: {
  hmake seen 100
  if ($isfile(seen.dat)) { hload seen seen.dat }
}
ON *:EXIT: {
  if ($hget(seen)) { hsave -o seen seen.dat }
}
ON *:TEXT:*:#: {
  hadd seen $nick text $chan $ctime $1-
  if ($1 = !seen) {
    if ($2 ison $chan) { msg $chan $2 is right here. }
    else { msg $chan $nick $+ : $seenparse($2) }
  }
}
alias seen {
  echo $colour(info) -a *** $seenparse($1)
}
ON *:ACTION:*:#: {
  hadd seen $nick act $chan $ctime $1-
}
ON *:QUIT: {
  hadd seen $nick quit $ctime $1-
}
on *:PART:#: {
  hadd seen $nick part $chan $ctime $1-
}
on *:JOIN:#: {
  hadd seen $nick join $chan $ctime $1-
}
ON *:NICK: {
  hadd seen $nick nick $newnick $ctime
}
ON *:KICK:#: {
  hadd seen $nick kicking $chan $ctime $knick $1-
  hadd seen $knick kick $chan $ctime $nick $1-
}
alias -l seenparse {
  var %x = $hget(seen,$1)
  if (!%x) { return I have not seen $1 }
  var %n = $1
  tokenize 32 %x
  if ($1 = text) { return I last saw %n in $2 $duration($calc($ctime - $3)) ago saying $4- }
  if ($1 = act) { return I last saw %n in $2 $duration($calc($ctime - $3)) ago acting $4- }
  if ($1 = quit) { return I last saw %n quiting $duration($calc($ctime - $2)) ago $iif($3,with the message $3-) }
  if ($1 = part) { return I last saw %n leaving $2 $duration($calc($ctime - $3)) ago with the message $4- }
  if ($1 = join) { return I last saw %n joining $2 $duration($calc($ctime - $3)) ago. }
  if ($1 = nick) { return I last saw %n changing their nickname to $2 $duration($calc($ctime - $3)) ago. }
  if ($1 = kicking) { return I last saw %n kicking $4 from $2 $duration($calc($ctime - $3)) ago with the reason $5- }
  if ($1 = kick) { return I last saw %n being kicked from $2 by $4 $duration($calc($ctime - $3)) with the reason $5- }
}

Comments

Sign in to comment.
x1L22   -  Jan 30, 2012

We provide all this bilgilerinn how a single command
!Seen Nick
Bot :
I last saw %n in $2 $duration($calc($ctime - $3)) ago saying $4- }
I last saw %n in $2 $duration($calc($ctime - $3)) ago acting $4- }
I last saw %n quiting $duration($calc($ctime - $2)) ago $iif($3,with the message $3-) }
I last saw %n leaving $2 $duration($calc($ctime - $3)) ago with the message $4- }
I last saw %n joining $2 $duration($calc($ctime - $3)) ago. }
I last saw %n changing their nickname to $2 $duration($calc($ctime - $3)) ago. }

 Respond  
x1L22   -  Jan 30, 2012

!Seen Kick Nick - !Seen Join nick etc. doesnt work

 Respond  
keaven   -  Jul 18, 2011

thanks jaytea! works like a charm :D
I've had to change ($1 = !seen) to (!seen isin $1) though... for some reason, ($1 = !x) or ($1 == !x) never triggers for me with mIRC 7.19 :\

 Respond  
jaytea   -  Jul 15, 2011

not at all difficult! here's a quick update:

ON *:TEXT:*:#: {
  hadd seen $nick text $chan $ctime $1-
  if ($1 = !seen) {
    if ($count($2, ?, *)) {

      var %max = 5 | ; maximum number of results

      var %i = 1, %n = $hfind(seen, $2, 0, w)
      msg $chan $nick $+ : %n result $+ $iif(%n != 1, s) for $2. $iif(%n > %max, Showing first %max) 
      while (%i <= %max) && ($hfind(seen, $2, %i, w)) {
        msg $chan $nick $+ : $seenparse($v1)
        inc %i
      }
    }
    elseif ($2 ison $chan) { msg $chan $2 is right here. }
    else { msg $chan $nick $+ : $seenparse($2) }
  }
}

replace the existing on TEXT event with that one. change %max if you like.

 Respond  
keaven   -  Jul 15, 2011

how difficult would it be to tweak this to accept wildcards, and return all fitting entries?

 Respond  
PATX   -  Mar 15, 2009

lol

 Respond  
Eugenio   -  Mar 15, 2009

smh

 Respond  
PATX   -  Mar 14, 2009

great script!

i will not say what i voted. however i will say that the average score went from 8.5 to 8.6

 Respond  
xplo   -  Nov 01, 2008

nice script. i use it, and i vote 9/10

it would be nice to be able to use wildcards and !@hosts.com

that would deserve a big 10

 Respond  
Eugenio   -  May 27, 2008

bloody good script
/me rates 9/10

 Respond  
Mitchell   -  Apr 20, 2008

awesome !seen script, works amazingly. great job :)

 Respond  
Blank   -  Sep 03, 2007

just a suggestion, but i added a timer that saved the hash db every 30 seconds, in case my computer crashed or lost power.

 Respond  
eddygordo   -  Jan 27, 2007

doesnt work for me =\

 Respond  
2slogan   -  May 19, 2006

I modified mines a lil so that it wouldnt say \"NAME, is right here\" when you try and search for yourself.

ON :TEXT::#: {
hadd seen $nick text $chan $ctime $1-
if ($1 = !seen) { if ($2 == $nick) { msg $chan $nick $+ , Lost Yourself? }
elseif ($2 ison $chan) { msg $chan $2 $+ , is right here. }
else { msg $chan $nick $+ : $seenparse($2) }
}
}

 Respond  
err2   -  Nov 09, 2005

finally a seen script that actually wrks fer me. gewd jobness

 Respond  
xwindows   -  Jan 27, 2005

The Code is Nice.. enks

 Respond  
squid   -  Sep 03, 2004

but mine didn\'t work, the bot replied nothing, what happen with the bot or the script ?

 Respond  
X-FILE   -  Jan 09, 2004

it works fine , nice to see a seen system using hash tables . Good Job tye

 Respond  
VVhispers   -  Jan 09, 2004

n/m, I fixed it...LoL....Don\'t ever edit a script thinking you know how...I tried to make it to where it won\'t display channel names...I succeeded but I messed up the time somehow...Works now, not tye\'s fault...twas my own

 Respond  
VVhispers   -  Jan 09, 2004

Hey, this code works and greatly, if not inaccurately...It says people joined, parted, quit, etc 35 years ago (1775 weeks)...

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.