xSeen v2.7

By xDaeMoN on Aug 21, 2005

A Seen script that has a seen notification.



Paste into remotes.

After you have pasted and saved either restart mIRC or type
'/hmake xSeen 100' into your status window.




Usage: /seen nick


other users can type: !seen nick



Credits: Tye, for his Simple Seen System and to the
authors of Gseen and Bseen tcls.



Update: Allows you to use wildcards. ( i.e. !seen mask or /seen mask )

;================================================
;  xSeen
;  Version 2.7
;  Written by: xDaeMoN
;  Email: xdaemon@xdaemon.us
;
; Usage: /seen <nick|*mask*>
; other users can type: !seen nick
;
; ** Credits: Tye, for his Simple Seen System and to the 
authors of Gseen and Bseen tcls.
;
;================================================

;####################### EVENTS #######################

On *:START: {
  if ( !$hget(xSeen) ) hmake xSeen 100
  if ($isfile($_seen.log)) hload xSeen $_seen.log
}

On *:EXIT: if ( $hget(xSeen) ) hsave -o xSeen $_seen.log

#xSeen on

ON *:TEXT:*:#: {
  xseen.add $+(seen.,$network,.,$address($nick,5)) text $ctime $chan
  if ($1 == !seen) && ( $$2 ) {
    if ( $2 == $me ) msg $chan $seenmsg.me($nick)
    elseif ( $2 == $nick ) msg $chan $seenmsg.self2($nick)
    elseif ($2 ison $chan) msg $chan $seenmsg.here($nick,$2)
    else msg $chan $nick $+ , $seenpar($+(seen.,$network,.,$2),$+(nseen.,$network,.,$2,.,$nick) $nick $ctime $chan $address)
  }
}

ON *:ACTION:*:#: xseen.add $+(seen.,$network,.,$address($nick,5)) act $ctime $chan

ON *:QUIT: xseen.add $+(seen.,$network,.,$address($nick,5)) quit $ctime $comchan($nick,1) $1-

on *:PART:#: xseen.add $+(seen.,$network,.,$address($nick,5)) part $ctime $chan $1-

on *:JOIN:#: {
  xseen.add $+(seen.,$network,.,$address($nick,5)) join $ctime $chan $1-
  nseen $+($network,.,$nick)
}

ON *:NICK: {
  xseen.add $+(seen.,$network,.,$nick,!,$address) nick $ctime $comchan($newnick,1) $newnick
  nseen $+($network,.,$newnick)
}

ON *:KICK:#: {
  xseen.add $+(seen.,$network,.,$address($nick,5)) kicking $ctime $chan $knick $1-
  xseen.add $+(seen.,$network,.,$address($knick,5)) kick $ctime $chan $nick $1-
}

#xSeen end

;####################### ALIASES #######################

alias -l xseen.add { 
  if ( $hfind(xSeen,$+($deltok($1,2,33),!*),1,w) ) { 
    if ( $v1 != $1 ) hdel xSeen $v1
  }
  hadd -m xSeen $1-
}

alias -l nseen {
  var %n3 = $1, %n = $hfind(xSeen,$+(nseen.,$1,.,*),0,w), %n2, %n4 = 1
  while %n { 
    %n2 = $hfind(xSeen,$+(nseen.,%n3,.,*),%n,w)
    tokenize 32 $hget(xSeen,%n2)
    .timer 1 $calc(%n3 * 2) .notice $gettok(%n3,2,46) $seenmsg.nseen($1,$4,$3,$!seentime( $2 ))
    hdel xSeen %n2
    inc %n4
    dec %n
  }
}

alias -l seenpar {
  if ( $count($1,*,?) ) { return $seenparse2($1,$iif($2,$2-)) }
  else return $seenparse3($1,$iif($2,$2))
}

alias -l seenparse {
  tokenize 32 $1-
  var %y = $hfind(xSeen,$+($1,!*),1,w), %x = $hget(xSeen,%y), %n = $deltok($gettok(%y,3,46),2,33), %m = $gettok(%y,2,33)
  if (!%x) return $seenmsg.notseen($deltok($gettok($1,3,46),2,32))
  if ( %n == $me ) return $seenmsg.me2
  if ( $2 ) {
    if ( $gettok($2,3,46) == $gettok($gettok($2,4,46),1,32) ) return $seenmsg.self
    hadd xSeen $2-
  }
  tokenize 32 %x
  if ($1 = text) { return $seenmsg.text(%n ,%m,$3,$seentime($2),$seen.onchan(%n,$3)) }
  if ($1 = act) { return $seenmsg.act(%n,%m,$3,$seentime($2),$seen.onchan(%n,$3)) }
  if ($1 = quit) { return $seenmsg.quit(%n,%m,$3,$seentime($2),$iif($4,stating $+($chr(40),$4-,$chr(41)))) }
  if ($1 = part) { return $seenmsg.part(%n,%m,$3,$seentime($2),$iif($4,stating $+($chr(40),$4-,$chr(41)))) }
  if ($1 = join) { return $seenmsg.join(%n,%m,$3,$seentime($2),$seen.onchan(%n,$3)) }
  if ($1 = nick) { return $seenmsg.nick(%n,%m,$3,$4,$seentime($2),$seen.onchan($4,$3)) }
  if ($1 = kicking) { return $seenmsg.kicking(%n,%m,$4,$3,$seentime($2),$+($5-,.),$seen.onchan(%n,$3)) }
  if ($1 = kick) { return $seenmsg.kick(%n,%m,$3,$4,$seentime($2),$5-) }
}

alias -l seenparse2 {
  tokenize 32 $1-
  var %s3 = $1, %s = $hfind(xSeen,$1,0,w), %s2 = $deltok($hfind(xSeen,$1,1,w),2,33)
  if ( !%s ) return $seenmsg.nomatch
  elseif ( %s == 1 ) return $seenparse(%s2,$2-)
  elseif ( %s < 40 ) { 
    return $seenparse.filter($+(%s,.,%s3),$2)
  }
  else return $seenmsg.manymatch(%s)
}

alias -l seenparse3 {
  var %g5 = $1-, %r = $hfind(xSeen,$+($1,!*),1,w), %g3 = $+($gettok(%r,1-2,46),.,*!,$gettok($deltok($gettok(%r,3-,46),1,33),1,64),@*)
  var %g = $hfind(xSeen,%g3,0,w)
  if ( %g == 1 ) || ( !%r ) return $seenparse(%g5)
  elseif ( %g < 40 ) { 
    return $seenparse.filter($+(%g,.,%g3),$2)
  }
  else return $seenmsg.manymatch(%g)
}

alias -l seenparse.filter {
  var %j = $gettok($1,1,46), %j3 = $gettok($1,2-4,46), %sfile = _stemp, %j2, %j9, %j4
  btrunc %sfile 0
  while %j {
    %j2 = $hfind(xSeen,%j3,%j,w)
    write %sfile $deltok($gettok(%j2,3,46),2,33) $gettok($hget(xSeen,%j2),2,32)
    dec %j
  }
  filter -cteuff 2 32 %sfile %sfile
  var %k = 1, %k1
  while $read(%sfile,%k) {
    %k1 = $addtok(%k1,$gettok($v1,1,32),32)
    inc %k
  }
  .remove %sfile
  %j9 = $numtok(%k1,32)
  %j4 = $gettok(%k1,1,32)
  return $iif(%j9 > 1, I found %j9 matches to your query $+ $iif(%j9 > 1,$iif(%j9 >= 5,. Here are the 5 most recent) $&
    (sorted): $iif(%j9 > 5, $gettok(%k1,1-5,32) $+ ., %k1 $+ .))) $seenparse($+(seen.,$network,.,%j4),$iif($2,$reptok($2,$gettok($2,3,46),%j4,1,46)))
}

alias seen { 
  if ( $1 ) echo $colour(info) -a *** $seenpar($+(seen.,$network,.,$1))
  else echo $colour(info) -a * /seen: insufficient parameters
}

alias -l seen.version return 2.7

alias -l _seen.file return $+(",$scriptdirxSeen.ini,")

alias -l _seen.log return $+(",$scriptdirxSeen.dat,")

alias -l seentime return $replace($duration($calc($ctime - $1)),wk,$+($chr(32),week),day,$+($chr(32),day),hr,$+($chr(32),hour),min,$+($chr(32),minute),sec,$+($chr(32),second))

;####################### MENU #######################

menu * {
  -
  xSeen v $+ $seen.version
  .$iif($group(#xSeen) == on,Disable,Enable) { 
    $iif($group(#xSeen) == on,.Disable,.Enable) #xSeen
    echo $colour(info) -a ** xSeen $seen.version $iif($group(#xSeen) != on,DisableD,EnableD)
  }
}

;####################### MESSAGES #######################

alias -l seenmsg.text return $1 ( $+ $2 $+ ) was last seen talking on $3 $4 ago. $5
alias -l seenmsg.act return $1 ( $+ $2 $+ ) was last seen acting on $3 $4 ago. $5
alias -l seenmsg.quit return $1 ( $+ $2 $+ ) was last seen quiting on $3 $4 ago $+($5,.)
alias -l seenmsg.part return $1 ( $+ $2 $+ ) was last seen leaving $3 $4 ago.
alias -l seenmsg.join return $1 ( $+ $2 $+ ) was last seen joining $3 $4 ago. $5
alias -l seenmsg.nick return $1 ( $+ $2 $+ ) was last seen changing nick on $3 to $4 $5 ago. $6
alias -l seenmsg.kicking return $1 ( $+ $2 $+ ) was last seen kicking $3 from $4 $5 ago with the reason: $+($6,.) $7
alias -l seenmsg.kick return $1 ( $+ $2 $+ ) was last seen kicked from $3 by $4 $5 with the reason: $+($6,.)
alias -l seenmsg.manymatch return I found $1 matches to your query; please refine it to see any output.
alias -l seenmsg.nomatch return No matches were found.
alias -l seenmsg.notseen return I have not seen $1 $+ .
alias -l seenmsg.me return $1 $+ , you found me!
alias -l seenmsg.me2 return I'm right here so quit wasting my time.
alias -l seenmsg.self return Looking for yourself, eh?!
alias -l seenmsg.self2 return $1 $+ , go look in the mirror!
alias -l seenmsg.here return $1 $+ , $2 is right here!
alias -l seenmsg.nseen return $1 ( $+ $2 $+ ) was looking for you on $3 $4 ago.
alias -l seen.onchan { if ( $1 ison $2 ) return $1 is still there. }

;####################### EOF #######################

Comments

Sign in to comment.
xDaeMoN   -  Nov 09, 2009

@ Xpl0reR, you could. =) Check my notes in the introduction above.

 Respond  
xplo   -  Nov 09, 2009

It would be great if you could look for everything with wildcards.
like ltes say there is this dude quitting.
[13:20:03] * Quits: cooldry (cooldry@142-217-4-180.telebecinternet.net) (Read error: EOF from client)

and you know his host is .180.telebecinternet.net you want to use /seen 180.telebecinternet.net

Would rock.

 Respond  
PATX   -  Mar 13, 2009

er just a sugestion cos i know that have pretty much debuged this thing but when someone tries to see somthinge/someone you could amke that modifier in that command's modifier -m for it to automaticly make a hash table when you first make the table. but as i said u woked that out using the on start commnd :p

 Respond  
xplo   -  Feb 28, 2009

for this you would need to have a on input event
type /help on input in mirc

 Respond  
Abtehi   -  Feb 27, 2009

can you change the seen command from "/seen" to ".seen" ?

 Respond  
T7Davey   -  Sep 15, 2007

I love it!

btw. Triple post abbas.

 Respond  
Abbas   -  Sep 15, 2007

good job
thanks

 Respond  
Lindrian   -  Dec 13, 2006

Never seen a better !seen system before! (@ http://mirc.net/projects.php?go=1135457129
http://mircscripts.org/comments.php?cid=2916 )

Very Impressive! Another great script by XDaeMon! Congratulations!
a 10/10 from me!

 Respond  
kaizerdragon   -  Jul 30, 2006

This is a good script!
I do have a question though...
I\'m a newbie about script so please be patient with me.
My question is I noticed you\'ve set a limit for this script, and whenever it hits 40 results it will just say to refine your search. So...is there anyway to get around that? like for example reload the log files but without removing others nickname logs?
Or maybe to reduce the number of hits?

Thanks

 Respond  
xDaeMoN   -  Feb 09, 2006

I never had a problem with that and still working fine as of today so I\'m not sure why you have that error. Unless you have an older version which I stated before.

 Respond  
No0ne   -  Feb 09, 2006

I guess its talking about this line.

if ( $v1 != $1 ) hdel xSeen $v1
 Respond  
No0ne   -  Feb 09, 2006

Yeah, i\'ve always used 6.16

 Respond  
xDaeMoN   -  Feb 09, 2006

Are you using the latest version of mIRC which is 6.16? If not, then this script will not work properly.

 Respond  
No0ne   -  Feb 09, 2006
  • /hdel: insufficient parameters (line 65, script2.ini)
  • ** xSeen 2.7 DisableD

 Respond  
xDaeMoN   -  Nov 24, 2005

Update:

-Added a check & message when people look for their nick.
-Changed \".notice $nick\" to \"msg $chan\" but not for the seen notifications.

 Respond  
Raid   -  Nov 24, 2005

LoL Thats a good thing.

Add a advertise feature: .Advertise:/msg $active xSeen by:xDaeMoN http://www.hawkee.com/snippet.php?snippet_id=1252

Also: Some people on the server I use Really like the feature that gisve them all the names they had been.
IE: *** I found 5 matches to your query. Here are the 5 most recent (sorted): [SI]Raid Raidhaunting-dvs-nightmares Raid [SI]Arruz [SI]Prophet. I\'m right here so quit wasting my time.

 Respond  
xDaeMoN   -  Nov 23, 2005

Minor update: Just took out the unload option in the pop-up menu so it won\'t unload the script when you accidentally click it.

 Respond  
xDaeMoN   -  Nov 21, 2005

Right, Yoinx.

Update:

  • Added \"-m\" switch
    -Changed \"if ( $chr(42) isin $1 ) || ( $chr(63) isin $1)\" to \"if( $count($1,*,?) )\"
 Respond  
Yoinx   -  Nov 21, 2005

xdaemon, you could also add the -m parameter to your hadds. that way they wont ever get that error anyway.

 Respond  
xDaeMoN   -  Nov 21, 2005

@ Son_Goku, sorry I forgot to change the instructions. Type \"/hmake xSeen 100\" to create the hash table.

 Respond  
Son_Goku   -  Nov 21, 2005

It\'s not working for me..

  • /hadd: no such table \'xSeen\' (line 51, script7.ini)
  • /hadd: no such table \'xSeen\' (line 51, script7.ini)
  • That happenes everytime someone joins the channel.

 Respond  
greenlanter420   -  Nov 21, 2005

hey great seen script personally I wouldn\'t change the way it notify\'s because you will get a bunch of people typin it to find out how long that person has been gone if more than one wants to know kinda annoying also just wondering I use it on a bot and when I type !seen thenmynick it says mynick is right here shouldn\'t it say lookin for why am I lookin for myself or somethin? other than that perfect.

 Respond  
xDaeMoN   -  Nov 18, 2005

Update:

-Fixed: saving of data
-Fixed: output data is not accurate because of data just being appended and not overwritten
-Now only using 1 hash table for seen data & notifications.
-Messages can now easily be changed (except for the wildcards part)
-Added Simple Menu

 Respond  
xDaeMoN   -  Nov 07, 2005

Minor Update: Added enhancement on seen time & added a message when a user tries to do !seen yourmask.

 Respond  
`Kazuma   -  Nov 05, 2005

xDaeMon: np. seems like you\'re putting alot of work into this. :)

 Respond  
xDaeMoN   -  Nov 05, 2005

Update: Fixed a bug when you do /seen mask, it still logs which should not.

 Respond  
xDaeMoN   -  Nov 05, 2005

Update: Fixed the On Nick event to save the full address of the previous nick.

 Respond  
Raid   -  Nov 05, 2005

:/ Opps raid didn\'t read all posts +slaps self+

 Respond  
xDaeMoN   -  Nov 05, 2005

Thanks =)

 Respond  
`Kazuma   -  Nov 05, 2005

very nice. gj

 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.