All pastes #482180 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-11 04:51 UTC
rendered paste body
on $*:TEXT:$(/^(?>\Q $+ $me $+ \E,? ?)?([!.@]seen).*/Si):#:{
  tokenize 32 $iif($me isin $1,$deltok($1-,1,32),$1-)
  if (($me != Plasma) && ($read(onebot.txt, s, $chan))) { halt }
  if ($readini(public_cmds.ini,Channels,$chan) == off) {
    /var %seen $iif($left($1,1) == @,notice $nick,.notice $nick)
  }
  else { 
    /var %seen $iif($left($1,1) == @,msg $chan,.notice $nick)
  }
  if (!$2) { 
    %seen $c1(Please input a valid user. Example:) $c2(!seen USER)
    halt
  }
  if ($2) {
    if ($2 == $nick) { 
      %seen $c1(I last saw you using this command!) 
      halt 
    }
    if ($2 ison $chan) { 
      %seen $c1(The user) $c2($2) $c1(is currently in the channel right now)
    }
    if (!$hget(Seen,$2)) { %seen $c1(The user) $c2($2) $c1(did not return any results. Please try again) 
      halt
    }
    else {
      /var %dur $gettok($hget(Seen,$2),2,32)
      /var %type $gettok($hget(Seen,$2),3,32)
      /var %chnk $gettok($hget(Seen,$2),4,32)
      /var %txt $gettok($hget(Seen,$2),5-,32)
      if (%type == TEXT) { %seen $c1(I last saw) $c2($2) $c1(talking in) $c2(%chnk) $c1(saying ") $+ $c2(%txt) $+ $c1(") $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == QUIT) { %seen $c1(I last saw) $c2($2) $c1(quitting saying ") $+ $c2(%txt) $+ $c1(") $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == PART) { %seen $c1(I last saw) $c2($2) $c1(parting in) $c2(%chnk) $iif(%txt != $null,$c1(saying ") $+ $c2(%txt) $+ $c1(")) $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == ACTION) { %seen $c1(I last saw) $c2($2) $c1(acting in) $c2(%chnk) $c1(acting ") $+ $c2(%txt) $+ $c1(") $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == KICK) { %seen $c1(I last saw) $c2($2) $c1(kick) $c2(%chnk) $c1(in) $c2($gettok($hget(Seen,$2),5,32)) $c1(saying ") $+ $c2($gettok($hget(Seen,$2),6,32)) $+ $c1(") $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == KICKED) { %seen $c1(I last saw) $c2($2) $c1(being kicked in) $c2($gettok($hget(Seen,$2),5,32)) $c1(by) $c2(%chnk) $c1(saying ") $+ $c2($gettok($hget(Seen,$2),6,32)) $+ $c1(") $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == BAN) { %seen $c1(I last saw) $c2($2) $c1(banning in) $c2(%chnk) $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == NICKCHG) { %seen $c1(I last saw) $c2($2) $c1(changing there nick to) $c2(%chnk) $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == FROMNICK) { %seen $c1(I last saw) $c2($2) $c1(changing there nick from) $c2(%chnk) $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
      if (%type == JOIN) { %seen $c1(I last saw) $c2($2) $c1(joining) $c2(%chnk) $c2($duration($calc($ctime - %dur))) $c1(ago.)
        halt
      }
    }
  }
}
on *:TEXT:*:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime TEXT $chan $1-
}
on *:QUIT:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime QUIT #CHAN $1-
}
on *:PART:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime PART $chan $1-
}
on *:ACTION:*:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime ACTION $chan $1-
}
on *:KICK:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime KICK $knick $chan $1-
  /hadd -m Seen $knick ADDRESS: $+ $address($knick,2) $ctime KICKED $nick $chan $1-
}
on *:BAN:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime BAN $bnick $chan
}
on *:NICK:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime NICKCHG $newnick
  /hadd -m Seen $newnick ADDRESS: $+ $address($nick,2) $ctime FROMNICK $nick

}
on *:JOIN:#:{
  /hadd -m Seen $nick ADDRESS: $+ $address($nick,2) $ctime JOIN $chan
}
on *:START:{ 
  /hmake Seen 100
  /hload Seen Seen.hsh
}
on *:EXIT:{ 
  /hsave Seen Seen.hsh 
}