!seen

From Scriptwiki
Revision as of 17:18, 30 November 2006 by Cail (talk | contribs) (blah, forgot one space)

Jump to: navigation, search

Pretty simple !seen script.

;Seen script, pretty much self-explanatory.
;Syntax:
;/seen on/off
;/seen add/del (word) [This is to stop people trying to do stuff like, !seen penis, or something  stupid.] 
;Just add any words you don't want to be used.
;/msg #channel/bot !seen name
;* 
; Ollie

alias seen {
  if ($1 == del) && ($2) {
    if (!$read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is not in the database. | return }
    write -dw $+ $2 funny.txt
    echo -a Removed: $+(",$2,",.) From the 'funny' words list.
    return
  }
  if ($1 == add) && ($2) {
    if ($read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is already in the database. | return }
    write funny.txt $2
    echo -a Added: $+(",$2,",.) To the 'funny' words list.
    return
  }
  if ($1 == on) {
    echo -a Seen Status: On
    set %seen on
    return
   }
  if ($1 == off) {
    echo -a Seen Status: Off
    set %seen off
    return
  }
  echo -a Unknown parameter.
}
on *:text:!seen*:*:{
  if (%seen == off) { return }
  var %target = $iif($chan,$chan,$nick)
  if (!$2) { notice $nick seen whom? | return }
  if ($2 == $nick) { 
    describe %target hands $nick a mirror. 
    return 
  }
  if ($chan) && ($2 ison $chan) { 
    msg %target $2 Is in the channel! $iif(%last.spoke. [ $+ [ $2 ] ],His/her last words were: %last.spoke. [ $+ [ $2 ] ],They haven't spoken anything yet!) 
    return 
  }
  if (!%seen. [ $+ [ $2 ] ] ) { 
    if ($read(funny.txt, w, $2)) { 
      msg %target hoho. aren't you a funny one 
      halt 
    } 
    if (!%seen. [ $+ [ $2 ] ] ) { 
      msg %target i have never seen $2 | return 
    }
  }
  if (%seen. [ $+ [ $2 ] ] ) { 
    msg %target I last saw $2 %seen. [ $+ [ $2 ] ] That was $duration($calc($ctime - %seen.last. [ $+ [ $2 ] ] )) ago. $iif(%last.spoke. [ $+ [ $2 ] ],If i remember correctly.. his last words were: %last.spoke. [ $+ [ $2 ] ],He left without saying anything!)
  }
}

on *:NICK:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] ( $+ $address($nick,2) $+ ) changing his/her nickname to $newnick
}

on *:kick:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $knick ] ] ( $+ $address($nick,2) $+ ) being kicked from $chan by $nick 
  set %seen.last. [ $+ [ $knick ] ] $ctime
}

on *:JOIN:#:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Joining channel $chan at $fulldate 
  set %seen.last. [ $+ [ $nick ] ] $ctime 
}

on *:text:*:#:{
  if (%seen == off) { return }
  set %last.spoke. [ $+ [ $nick ] ] $1-
}

on *:quit:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Quitting at $fulldate 
  set %seen.last. [ $+ [ $nick ] ] $ctime 
}

on *:part:#:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Parting at $fulldate 
  set %seen.last. [ $+ [ $nick ] ] $ctime 
}