This script is quite simple. Just load it and you're set. It will keep track of what users do, then when somebody needs to locate them, they can type !seen <username / search> in a channel... and it will find either the username, or the latest matches to the search.
; Hyper's Last Seen Script
; Last Edit: January 30, 2006
; For help...
; irc.enterthegame.com #null
; ...or...
; http://nullprod.abacionline.com/forum
on *:START:{
if (!$hget(LastSeen)) { .hmake LastSeen 100 }
if ($exists(LastSeen.hsh)) { .hload LastSeen LastSeen.hsh }
}
on *:TEXT:!seen*:#:{
if (!$2) { halt }
else {
var %seen.entry = $hget(LastSeen,$2), %seen.action = $null, %seen.name = $2
if ($nick == $2) { msg $chan Hey, Narcisso, stop looking for yourself. | halt }
elseif ($2 == $me) { describe $chan waves to $nick $+ . | halt }
elseif ($2 ison $chan) { msg $chan $2 is currently in the channel! | halt }
elseif (!%seen.entry) {
var %seen.num = $hfind(LastSeen,* $+ $2 $+ *,0,w)
if (%seen.num == 0) {
msg $chan I found no results for your LastSeen query.
halt
}
else {
var %seen.i = 1
while (%seen.i <= $hfind(LastSeen,* $+ $2 $+ *,0,w)) {
write LastSeen.tmp $hfind(LastSeen,* $+ $2 $+ *,%seen.i,w) $hget(LastSeen,$hfind(LastSeen,* $+ $2 $+ *,%seen.i,w))
inc %seen.i
}
filter -ffteu 3 32 LastSeen.tmp LastSeen2.tmp *
msg $chan I found %seen.num results for your LastSeen query. $iif(%seen.num > 5,Here are the top 5,Here are the results) $+ , starting with the newest result: $gettok($read(LastSeen2.tmp,1),1,32) $gettok($read(LastSeen2.tmp,2),1,32) $gettok($read(LastSeen2.tmp,3),1,32) $gettok($read(LastSeen2.tmp,4),1,32) $gettok($read(LastSeen2.tmp,5),1,32)
%seen.name = $gettok($read(LastSeen2.tmp,1),1,32)
.remove LastSeen.tmp
.remove LastSeen2.tmp
}
}
%seen.entry = $hget(LastSeen,%seen.name)
%seen.action = $replace($gettok(%seen.entry,3,32),JOIN,joining $gettok(%seen.entry,4,32) $+ .)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),TEXT,talking in $gettok(%seen.entry,4,32) $+ . They were saying: $gettok(%seen.entry,5-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),ACT,acting in $gettok(%seen.entry,4,32) $+ . They were saying: * $2 $gettok(%seen.entry,5-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),PART,parting from $gettok(%seen.entry,4,32) $+ $chr(44) stating: $gettok(%seen.entry,5-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),QUIT,quitting from IRC $+ $chr(44) saying: $gettok(%seen.entry,4-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),KICKED,being kicked from $gettok(%seen.entry,5,32) by $gettok(%seen.entry,4,32) $+ $chr(44) who stated: $gettok(%seen.entry,6-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),KICK,kicking $gettok(%seen.entry,4,32) from $gettok(%seen.entry,5,32) $+ $chr(44) stating: $gettok(%seen.entry,6-,32)),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),FROMNICK,changing nicknames from their old nick $+ $chr(44) which was $gettok(%seen.entry,4,32) $+ .),%seen.action)
%seen.action = $iif(%seen.action == $gettok(%seen.entry,3,32),$replace($gettok(%seen.entry,3,32),CHNICK,changing their nickname to $gettok(%seen.entry,4,32) $+ .),%seen.action)
%seen.entry = I last saw $+ %seen.name $+ ( $+ $gettok(%seen.entry,1,32) $+ ) $duration($calc($ctime - $gettok(%seen.entry,2,32))) ago, %seen.action
msg $chan %seen.entry
}
}
on *:JOIN:#:{
.hadd -m LastSeen $nick $address $ctime JOIN $chan
}
on *:TEXT:*:#:{
.hadd -m LastSeen $nick $address $ctime TEXT $chan $1-
}
on *:ACTION:*:#:{
.hadd -m LastSeen $nick $address $ctime ACT $chan $1-
}
on *:PART:#:{
.hadd -m LastSeen $nick $address $ctime PART $chan $1-
}
on *:QUIT:{
.hadd -m LastSeen $nick $address $ctime QUIT $1-
}
on *:KICK:#:{
.hadd -m LastSeen $nick $address $ctime KICK $knick $chan $1-
.hadd -m LastSeen $knick $remove($address($knick,5),$knick $+ !) $ctime KICKED $nick $chan $1-
}
on *:NICK:{
.hadd -m LastSeen $newnick $address $ctime FROMNICK $nick
.hadd -m LastSeen $nick $address $ctime CHNICK $newnick
}
on *:DISCONNECT:{
.hsave -o LastSeen LastSeen.hsh
}
on *:EXIT:{
.hsave -o LastSeen LastSeen.hsh
}