snitch

By Jeuz on Nov 19, 2005

just a fun code i wrote so you can "snitch" on what people said about each other
it saves all text from any room you are in and saves it to the text file of whatever nick said it..

it then has the option to be repeated by the
!snitch command (this gives a random text line from there text file)
or
!snitch (for a specific word in the text file)
it can be used by other users even those who use colours and
even be used by the user by replacing !snitch with /snitch

the help file is !shelp(for other users) and /shelp (for the user)
this is also available in the menubar along with a way to delete the logs if they start to take upto much space and a way to set the folder to save too.

REMEMBER TO GOTO MENUBAR>SNITCH>SET LOG FILE WHEN YOU LOAD THIS SNIPPET

and many thanks to yoinx for helping with this

menu menubar {
  -
  Snitch
  .Enable:Enable #snitch | echo -a 4S14nitch Is 4ENABLED
  .Disable:disable #snitch | echo -a 4S14nitch Is 4DISABLED
  .-
  .Set Log File: set %slog $sdir(c) | echo -a 4S14nitch 4F14older Is Set To4 %slog
  .Clear Logs:sclean
  .-
  .Help:shelp
}
on *:start: {
  echo -a 4S14nitch Created By 4Jeuz
  echo -a 14Type 4/shelp14 For Help 
  echo -a 14Get Users To Type 4!shelp14 For Help
  echo -a 14Any Problems Contact Me At:12 Pete@Jeuz.org
  enable #snitch | echo -a 4S14nitch Is 4ENABLED
}
on *:text:!shelp:#: {
  .notice 4S14nitch 4h14elp:
  .notice $nick 14Type 12!snitch14 <4nickname14> For A Random Sentence From <4nickname14>
  .notice $nick 14For Example 4!snitch $me ...14 could respond4 $me said Hi $nick 
  .notice $nick 14Type 12!snitch14 <4nickname14> <4searchword14> For A Sentence From <4nickname14> Containing That Word
  .notice $nick 14For Example 4!snitch $me hi ...14 could respond4 $me said Hi $nick
}
alias sclean {
  echo -a 4S14nitch 4L14og Is 4CLEARED
  while ($findfile(%slog,*.txt,0) > 1) { 
    .echo -q $findfile(%slog,*.txt,1,remove $1-) 
  } 
}
alias snitch {
  if ($2 == $null) && ($read($($+(%slog,$1,.txt),2))) echo -a 4S14nitch 4R14esult: $+(4,$1) said $gettok($read($($+(%slog,$1,.txt),2)),2-,32)
  elseif ($read($($+(%slog,$1,.txt),2),w, $($+(*,$2,*),2))) echo -a 4S14nitch 4R14esult: $+(4,$1) said $gettok($read($($+(%slog,$1,.txt),2),w, $($+(*,$2,*),2)),2-,32)
  else echo -a  4R14esult: Sorry I Dont Have Any Results For That Nickname  
}

alias shelp {
  echo -a 4S14nitch 4H14elp:
  echo -a 14Type 12/snitch14 <4nickname14> For A Random Sentence From <4nickname14>
  echo -a 14For Example 4!snitch $me ...14 could respond4 $me said Hi $nick 
  echo -a 14Type 12/snitch14 <4nickname14> <4searchword14> For A Sentence From <4nickname14> Containing That Word
  echo -a 14For Example 4!snitch $me hi ...14 could respond4 $me said Hi $nick 
}

#snitch off
on *:text:*:#: {
  tokenize 32 $strip($1-,burc)
  if ($1 == !snitch) {
    if ($3 == $null) && ($read($($+(%slog,$2,.txt),2))) {
      msg # $+(4,$2) said $gettok($read($($+(%slog,$2,.txt),2)),2-,32) 
    }
    elseif ($read($($+(%slog,$2,.txt),2),w, $($+(*,$3,*),2))) {
      msg # $+(4,$2) said $gettok($read($($+(%slog,$2,.txt),2),w, $($+(*,$3,*),2)),2-,32)
    }
    else msg # Sorry I Dont Have Any Results For That Nickname 
  } 
  if ($1 != !snitch) {
    write $($+(%slog,$mkfn($nick),.txt),2) $nick $1- 
  }
}
on *:input:*: {
  write $($+(%slog,$mkfn($me),.txt),2) $nick $1- 
} 

Comments

Sign in to comment.
Jeuz   -  Nov 23, 2005

fixed the fact that it didnt work... =/

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.