!seen: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
Ollie (talk | contribs)
No edit summary
Ollie (talk | contribs)
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
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:*:{
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 *: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:{
  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
  set %seen.last. [ $+ [ $nick ] ] $ctime
  }
  }
   
   
  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. [ $+ [ $knick ] ] $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
}
  on *:part:#:{
  if (%seen == off) { return }
  set %seen. [ $+ [ $nick ] ] $address($nick,2) Parting at $fulldate
  set %seen.last. [ $+ [ $nick ] ] $ctime  
  }
  }
[[Category:Script Archive]]
[[Category:Script Archive]]

Latest revision as of 16:49, 19 March 2007

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
  set %seen.last. [ $+ [ $nick ] ] $ctime
}

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 
}