Difference between revisions of "!seen"

From Scriptwiki
Jump to: navigation, search
Line 11: Line 11:
 
   
 
   
 
  alias seen {
 
  alias seen {
  if ($1 == del) && ($2) {
+
if ($1 == del) && ($2) {
  if (!$read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is not in the database. | return }
+
if (!$read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is not in the database. | return }
    write -dw $+ $2 funny.txt
+
write -dw $+ $2 funny.txt
    echo -a Removed: $+(",$2,",.) From the 'funny' words list.
+
echo -a Removed: $+(",$2,",.) From the 'funny' words list.
    return
+
return
  }
+
}
  if ($1 == add) && ($2) {
+
if ($1 == add) && ($2) {
    if ($read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is already in the database. | return }
+
if ($read(funny.txt, w, $2)) { echo -a Error: $+(",$2,") is already in the database. | return }
    write funny.txt $2
+
write funny.txt $2
    echo -a Added: $+(",$2,",.) To the 'funny' words list.
+
echo -a Added: $+(",$2,",.) To the 'funny' words list.
    return
+
return
  }
+
}
  if ($1 == on) {
+
if ($1 == on) {
    echo -a Seen Status: On
+
echo -a Seen Status: On
    set %seen on
+
set %seen on
    return
+
return
  }
+
}
  if ($1 == off) {
+
if ($1 == off) {
    echo -a Seen Status: Off
+
echo -a Seen Status: Off
    set %seen off
+
set %seen off
    return
+
return
  }
+
}
  echo -a Unknown parameter.
+
echo -a Unknown parameter.
 
  }
 
  }
 
  on *:text:!seen:*:{
 
  on *:text:!seen:*:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  var %target = $iif($chan,$chan,$nick)
+
var %target = $iif($chan,$chan,$nick)
  if ($3 == $nick) {  
+
if ($3 == $nick) {  
    describe %target hands $nick a mirror.  
+
describe %target hands $nick a mirror.  
    return  
+
return  
  }
+
}
  if ($chan) && ($3 ison $chan) {  
+
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!
+
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  
    return  
+
}
  }
+
if (!%seen. [ $+ [ $3 ] ] ) {  
  if (!%seen. [ $+ [ $3 ] ] ) {  
+
if ($read(funny.txt, w, $3)) {  
    if ($read(funny.txt, w, $3)) {  
+
msg %target hoho. aren't you a funny one  
      msg %target hoho. aren't you a funny one  
+
halt  
      halt  
+
}  
    }  
+
if (!%seen. [ $+ [ $3 ] ] ) {  
    if (!%seen. [ $+ [ $3 ] ] ) {  
+
msg %target i have never seen $3 | return  
      msg %target i have never seen $3 | return  
+
}
    }
+
}
  }
+
if (%seen. [ $+ [ $3 ] ] ) {  
  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!)
    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:{
 
  on *:NICK:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] ( $+ $address($nick,2) $+ ) changing his/her nickname to $newnick
+
set %seen. [ $+ [ $nick ] ] ( $+ $address($nick,2) $+ ) changing his/her nickname to $newnick
 
  }
 
  }
 
   
 
   
 
  on *:kick:{
 
  on *:kick:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  set %seen. [ $+ [ $knick ] ] ( $+ $address($nick,2) $+ ) being kicked from $chan by $nick  
+
set %seen. [ $+ [ $knick ] ] ( $+ $address($nick,2) $+ ) being kicked from $chan by $nick  
  set %seen.last. [ $+ [ $nick ] ] $ctime
+
set %seen.last. [ $+ [ $nick ] ] $ctime
 
  }
 
  }
 
   
 
   
 
  on *:JOIN:#:{
 
  on *:JOIN:#:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Joining channel $chan at $fulldate  
+
set %seen. [ $+ [ $nick ] ] $address($nick,2) Joining channel $chan at $fulldate  
  set %seen.last. [ $+ [ $nick ] ] $ctime  
+
set %seen.last. [ $+ [ $nick ] ] $ctime  
 
  }
 
  }
 
   
 
   
 
  on *:text:*:#:{
 
  on *:text:*:#:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  set %last.spoke. [ $+ [ $nick ] ] $1-
+
set %last.spoke. [ $+ [ $nick ] ] $1-
 
  }
 
  }
 
   
 
   
 
  on *:quit:{
 
  on *:quit:{
  if (%seen == off) { return }
+
if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Quitting at $fulldate  
+
set %seen. [ $+ [ $nick ] ] $address($nick,2) Quitting at $fulldate  
  set %seen.last. [ $+ [ $nick ] ] $ctime  
+
set %seen.last. [ $+ [ $nick ] ] $ctime  
 
  }
 
  }
  
 
[[Category:Script Archive]]
 
[[Category:Script Archive]]

Revision as of 00:08, 10 October 2006

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 
}