!seen

From Scriptwiki
Revision as of 23:08, 9 October 2006 by Ollie (talk | contribs)

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 ($3 == $nick) { 
describe %target hands $nick a mirror. 
return 
}
if ($chan) && ($3 ison $chan) { 
msg %target $3 Is in the channel! $iif(%last.spoke. [ $+ [ $3 ] ],His/her last words were: %last.spoke. [ $+ [ $3 ] ],They haven't spoken anything yet!) 
return 
}
if (!%seen. [ $+ [ $3 ] ] ) { 
if ($read(funny.txt, w, $3)) { 
msg %target hoho. aren't you a funny one 
halt 
} 
if (!%seen. [ $+ [ $3 ] ] ) { 
msg %target i have never seen $3 | return 
}
}
if (%seen. [ $+ [ $3 ] ] ) { 
msg %target I last saw $3 %seen. [ $+ [ $3 ] ] That was $duration($calc($ctime - %seen.last. [ $+ [ $3 ] ] )) ago. $iif(%last.spoke. [ $+ [ $3 ] ],If i remember correctly.. his last words were: %last.spoke. [ $+ [ $3 ] ],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. [ $+ [ $nick ] ] $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 
}