on *:start: { hmake seen hload seen seen.htb hmake seen2 hload seen2 seen2.htb } #seenscript on on *:join:#: { hadd -m seen $nick at $asctime joined $chan address: $address($nick,5) hadd -m seen2 $nick $address($nick,5) } on *:part:#: { hadd -m seen $nick at $asctime left $chan address: $address($nick,5) } if ($address($nick,5)) { hadd -m seen2 $nick $address($nick,5) } on *:quit: { hadd -m seen $nick at $asctime quit irc reason: $+ $1- address: $address($nick,5) } if ($address($nick,5)) { hadd -m seen2 $nick $address($nick,5) } on *:kick:#: { hadd -m seen $knick at $asctime got kicked from $chan reason: $+ $1- address: $address($knick,5) } if ($address($knick,5)) { hadd -m seen2 $knick $address($knick,5) } on *:nick: { hadd -m seen $nick at $asctime changed nick to $newnick address: $address($newnick,5) } if ($address($newnick,5)) { hadd -m seen2 $newnick $address($newnick,5) } on *:text:!seen*:#: { if ($strip($2-) ison $chan) { if (%seenreply == notice) { .notice $nick look around $strip($2-) is on channel } if (%seenreply == msg) { .msg $nick look around $strip($2-) is on channel } if (%seenreply == chan) { .msg $chan $nick look around $strip($2-) is on channel } } elseif ($hget(seen,$strip($2-))) { if (%seenreply == notice) { .notice $nick i last seen $strip($2-) $hget(seen,$strip($2-)) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$strip($2-)),2-6,32)))) ago } if (%seenreply == msg) { .msg $nick i last seen $strip($2-) $hget(seen,$strip($2-)) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$strip($2-)),2-6,32)))) ago } if (%seenreply == chan) { .msg $chan $nick i last seen $strip($2-) $hget(seen,$strip($2-)) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$strip($2-)),2-6,32)))) ago } } elseif ($hget(seen,$strip($2-)) == $null) { var %seenx 1,%seeny while ($hget(seen2,%seenx).data) { if ($strip($2-) iswm $hget(seen2,%seenx).data) && ($numtok(%seeny,32) < 11) { %seeny = $addtok(%seeny,$hget(seen2,%seenx).data,32) } inc %seenx } if ($numtok(%seeny,32) == 1) { if (%seenreply == notice) { .notice $nick found 1 match for $strip($2-) , i last seen $hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data),2-6,32)))) ago } if (%seenreply == msg) { .msg $nick found 1 match for $strip($2-) , i last seen $hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data),2-6,32)))) ago } if (%seenreply == chan) { .msg $chan $nick found 1 match for $strip($2-) , i last seen $hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data) it was $duration($calc($ctime - $ctime($gettok($hget(seen,$hmatch(seen,$+(*,%seeny,*),1).data),2-6,32)))) ago } } if ($numtok(%seeny,32) > 10) { if (%seenreply == notice) { .notice $nick your request is too high , try to be more specific highest 10 matches result can be replied } if (%seenreply == msg) { .msg $nick your request is too high , try to be more specific highest 10 matches result can be replied } if (%seenreply == chan) { .msg $chan $nick your request is too high , try to be more specific highest 10 matches result can be replied } } if ($numtok(%seeny,32) < 11) && ($numtok(%seeny,32) > 1) { if (%seenreply == notice) { .notice $nick found $numtok(%seeny,32) matches for your request %seeny try to request any of them } if (%seenreply == msg) { .msg $nick found $numtok(%seeny,32) matches for your request %seeny try to request any of them } if (%seenreply == chan) { .msg $chan $nick found $numtok(%seeny,32) matches for your request %seeny try to request any of them } } if ($numtok(%seeny,32) == 0) { if (%seenreply == notice) { .notice $nick sorry no result found for your request } if (%seenreply == msg) { .msg $nick sorry no result found for your request } if (%seenreply == chan) { .msg $chan $nick sorry no result found for your request } } } } on *:exit: { hsave -o seen seen.htb | hsave -o seen2 seen2.htb } on *:disconnect: { hsave -o seen seen.htb | hsave -o seen2 seen2.htb } #seenscript end