Here is the "Seen" code snippet i were found on the internet, i don't remember which website or forum...
I want the resutl of code are:
Here are an examples:
When some one type this command: !seen <nick> or !seen <ip/host> (*!*@1.2.3 or *!*@xyz.host.com)

1. Found (4) results "BiRain MrChair MrRolex Vida". Most recently BiRain (webchat@45.120.228.2) left IRC about 3 hours 22 minutes ago (12/05/2023-09:53:02) with message: "Read error: EOF from client", after BiRain stayed 47 minutes on #helpchan. As far as I know, BiRain hasn't said anything.

2. nps (nps@azygous.users.undernet.org) was last seen on #siargao. nps is still on #siargao. As far as I know, 2 hours 4 minutes ago, nps (nps@azygous.users.undernet.org) said on #siargao: "maryn"

3. I dont remember seeing Vida lately.. (Vida is a nickname an example).

4. Life (Life@Life.users.undernet.org) was last seen on #siargao. Unable to see Life right now on #siargao. As far as I know, 5 minutes ago, Life (Life@Life.users.undernet.org) said on #siargao: "!seen nps"

5. ChanGuard (~Life@Life.users.undernet.org) was last seen parting #siargao 20 seconds ago (03/01/2024 13:35:30), after stayed 10 minutes on #siargao.

Here is code:
Code
on ^*:TEXT:*:#:{
  if ($1 == !seen) || ($1 == .seen) || ($1 == @seen) && (!%seen) { check_seenanother_flood $nick
    if ($2) && ($2 != |) && ($left($2,1) != $) {
      if ($2 == $nick) { msg $chan [Seen] Are you looking for yourself, $nick $+ ? }
      if ($2 ison $chan) { msg $chan [Seen] $2 is still on the channel $chan $+ . }
      elseif ($2 == $me) { msg $chan $nick $+ : Sorry, you cann't seen me. }
      else {
        if (*!*@* iswm $2) {
          if ($read(seen.txt,w,* * $+ $2 $+ * :*)) { 
            var %seennickvar = $lines(seen.txt), %seennicks, %seennick
            while ($readn <= %seennickvar) {
              if ($read(seen.txt,w,* * $+ $2 $+ * :*,$calc($readn +1))) {
                var %seennickvar2 = $ifmatch
                if ($count(%seennicks,$chr(32)) < 20) && (*. $+ $gettok(%seennickvar2,1,32) $+ ,* !iswm %seennicks) { set %seennicks %seennicks , $+ $gettok(%seennickvar2,1,32) $+ , | inc %seennick }
              }
              else { set %seennickvar 0 }
            }
            if (%seennick == 1) { seen $chan $read(seen.txt,w,* * $+ $2 $+ * :*) }     
            elseif (%seennick < 20) { msg $chan $nick $+ : Found %seennick matching nicks: $left($remove(%seennicks,.),-1) $+ . }   
            else { msg $chan [Seen] To many results $nick $+ , try spesific it a bit more. }  
          }                                
          else { msg $chan $nick $+ : No matches were found matching your search. }
        }
        else {
          if ($read(seen.txt,w,* $+ $2 $+ * *!*@* :*)) { 
            if ($read(seen.txt,w,$2 *)) { seen $chan $ifmatch }
            else {
              var %seennickvar = $lines(seen.txt), %seennicks, %seennick
              while ($readn <= %seennickvar) {
                if ($read(seen.txt,w,* $+ $2 $+ * *!*@* :*,$calc($readn +1))) {
                  var %seennickvar2 = $ifmatch
                  if ($count(%seennicks,$chr(32)) < 20) && (*. $+ $gettok(%seennickvar2,1,32) $+ ,* !iswm %seennicks) { set %seennicks %seennicks . $+ $gettok(%seennickvar2,1,32) $+ , | inc %seennick }      
                }
                else { set %seennickvar 0 }
              }
              if (%seennick == 1) { seen $chan $read(seen.txt,w,* $+ $2 $+ * *!*@* :*) }        
              elseif (%seennick < 20) { msg $chan [Seen] Found %seennick matching nicks: $left($remove(%seennicks,.),-1) $+ . }   
              else { msg $chan $nick $+ : To many results $nick $+ , try spesific it a bit more. }  
            }              
          }                  
          else { msg $chan $nick $+ : Sorry, i don't remember seeing $2 lately. }
        }
      }
    }
    else { msg $chan $nick $+ : Error command, Syntax: ./!/@seen <nick/mask> }
    .ignore -u2 $nick
    set -u3 %seen 1
  }
}
alias -l check_seenanother_flood {
  var %nickseenanother $1, %hostseenanother $ial($1).host, %delay_seenanother_time 10
  if ($hget(stop-seenanother-flood,%hostseenanother)) {
    if (!$hget(stop-seenanother-flood-msg, %hostseenanother)) {
      msg $chan -ATTENTION- %nickseenanother $+ , You have recently used this command, further attempts will be ignored. Please wait a while to reused...
      .hadd -mz stop-seenanother-flood-msg %hostseenanother %delay_seenanother_time
    }
    halt
  }
  .hadd -mz stop-seenanother-flood %hostseenanother %delay_seenanother_time
}
alias seen {
  if ($gettok($2-,3,32) == :SAY) { msg $1 [Seen] As far as I know, $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen said on $gettok($2-,6,32) $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) ago with the text message: " $+ $gettok($2-,7-,32) $+ ". }
  if ($gettok($2-,3,32) == :JOIN) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen joined $gettok($2-,6,32) $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) ago. $gettok($2-,1,32) is still on $gettok($2-,6,32) $+ . }
  if ($gettok($2-,3,32) == :PART) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen parted $gettok($2-,6,32) for $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) $iif($gettok($2-,7,32),ago with the part message " $+ $gettok($2-,7-,32) $+ ".,ago. And after $gettok($2-,1,32) stayed $duration($calc($gettok($2-,5,32))) on $gettok($2-,6,32)) $+ . }
  if ($gettok($2-,3,32) == :KICK) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen when he got kicked by $gettok($2-,7,32) from $gettok($2-,6,32) in $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) ago with the kick message " $+ $gettok($2-,8-,32) $+ ". And after $gettok($2-,1,32) stayed $duration($calc($gettok($2-,5,32))) on $gettok($2-,6,32)) $+ . }
  if ($gettok($2-,3,32) == :KICKING) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen kicked $gettok($2-,7,32) from $gettok($2-,6,32) in $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) ago with the kick message " $+ $gettok($2-,8-,32) $+ ". }             
  if ($gettok($2-,3,32) == :TOPIC) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen changing topic in $gettok($2-,6,32) from $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) ago. }            
  if ($gettok($2-,3,32) == :NICK) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) was last seen changing nick to $+(,$gettok($2-,6,32),) on ( $+ $gettok($2-,4-5,32) $+ ). As far as I know $+(,$gettok($2-,1,32),) has changed nick for $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ago. }            
  if ($gettok($2-,3,32) == :QUIT) { msg $1 [Seen] $gettok($2-,1,32) ( $+ $right($gettok($2-,2,32),-3) $+ ) has left IRC $duration($calc($ctime - $ctime($gettok($2-,4-5,32)))) ( $+ $gettok($2-,4-5,32) $+ ) $iif($gettok($2-,6,32),ago with the quit message " $+ $gettok($2-,6-,32) $+ ".,ago.) As far as I know, $gettok($2-,1,32) has online for $duration($calc($gettok($2-,5,32))) after left IRC. }
}
on *:text:*:#: {
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :SAY $date $time $chan $remove($strip($1-,bruc),$,|,$chr(35))
  }
}
on *:action:*:#: {
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :SAY $date $time $chan $remove($strip($1-,bruc),$,|,$chr(35))
  }
}
on *:join:#: {
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :JOIN $date $time $chan
  }
} 
on *:part:#:{
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :PART $date $time $chan $remove($strip($1-,bruc),$,|,$chr(35))
  }
}
on *:kick:#:{
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :KICKING $date $time $chan $knick $remove($strip($1-,bruc),$,|,$chr(35))
  } 
  if ($knick != $me) && ($address($knick,1)) {
    write -dw"* $+ $address($knick,1) $+ *" seen.txt
    write -dw" $+ $knick *" seen.txt
    write seen.txt $knick $address($knick,1) :KICK $date $time $chan $nick $remove($strip($1-,bruc),$,|,$chr(35))
  } 
}
on *:topic:#: {
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :TOPIC $date $time $chan
  }
}
on *:nick: {
  if ($nick != $me) && ($address($newnick,1)) {
    write -dw"* $+ $address($newnick,1) $+ *" seen.txt
    write -dw" $+ $newnick *" seen.txt
    write seen.txt $nick $address($newnick,1) :NICK $date $time $newnick
  }
}
on *:quit: {
  if ($nick != $me) && ($address($nick,1)) {
    write -dw"* $+ $address($nick,1) $+ *" seen.txt
    write -dw" $+ $nick *" seen.txt
    write seen.txt $nick $address($nick,1) :QUIT $date $time $remove($strip($1-,bruc),$,|,$chr(35))
  }
}

File seen.txt like this:
pumpkin *!*~hollow@188.64.15.179 :QUIT 12/11/2023 06:04:58 Read error: Connection reset by peer
rolandcool *!*~rolandcoo@35.236.223.60 :JOIN 12/11/2023 12:14:34 #freeirc
Prodigious^ *!*67d614bc@ircip1.mibbit.com :PART 12/11/2023 21:47:01 #GiRLs
rsvp *!*~rsvpfr@Varsator.users.undernet.org :NICK 14/11/2023 00:40:59 dba
Lampa *!*mona@monalisa2.users.undernet.org :SAY 03/12/2023 02:43:48 #Official lasa ca le vedem cand intra si ia ban :P
....

Thanks all for help, i'm waiting for new version of this code.....from some one in here