simple blacklist..

By juhapuha on May 06, 2008

Simple shitlist popup:
add shitlisted hostmask
del shitlisted hostmask
look at the list of shitlisted hostmasks
delete all shitlisted hostmasks
maybe a good feature: on unload the script deletes itself and the shitlist table from memory and from mircdir.
Very easy to use.
Doesn't allow adding a hostmask to shitlist if there is 10 or more users found matching the mask..

#############################
#   Script    : Shitlist    #
#   Author    : Shitbreak   #
#   Network   : QuakeNet    #
#   Channel   : #Servicebot #
#   Year      : 2008        #
#############################
on *:load:{
  echo 2 -a * You have succesfully loaded shitlist script by shitbreak.
  echo 2 -a * Checking for the shitlist table...
  if (!$hget(shitlist)) { 
    echo 2 -a * Shitlist table does not exist.
    hmake shitlist
    echo 2 -a * Made the table shitlist.
  }
  if ($exists(shitlist.hsh)) { 
    hload shitlist shitlist.hsh
    echo 2 -a * Loaded shitlist table. 
  }
  if (!$exists(shitlist.hsh)) {
    hsave shitlist shitlist.hsh
    echo 2 -a * Shitlist table was not found from $mircdir $+ : It is now saved there.
  }
} 
on *:unload:{
  echo 2 -a * Thank you for using the shitlist snippet.
  if ($hget(shitlist)) { .hfree shitlist }
  if ($exists(shitlist.hsh)) { .remove shitlist.hsh }
  .remove $+(",$script,")
  echo 2 -a * Shitlist is now removed and the script. Shitlist table is already removed from memory.
}
on *:start:{
  echo 2 -a * Checking for the shitlist table...
  if (!$hget(shitlist)) { 
    echo 2 -a * Shitlist table does not exist.
    hmake shitlist
    echo 2 -a * Made the table shitlist.
  }
  if ($exists(shitlist.hsh)) { 
    hload shitlist shitlist.hsh
    echo 2 -a * Loaded shitlist table from $mircdir $+ .
  }
  if (!$exists(shitlist.hsh)) {
    hsave shitlist shitlist.hsh
    echo 2 -a * Shitlist table was not found from $mircdir $+ : It is now saved there.
  }
} 
on *:disconnect:{
  if (!$hget(shitlist)) {
    echo 2 -a * Shitlist table not loaded, we are not saving it.
  }
  if ($hget(shitlist)) {
    hsave shitlist shitlist.hsh
    echo 2 -a * Shitlist table is now saved to $mircdir
  }
}
on *:exit:{
  if ($hget(shitlist)) { hsave shitlist shitlist.hsh } 
}
menu channel {
  ...Shitlist by shitbreak
  ..Add user:{ 
    set %mask $$?="Hostname for the user" 
    if ($hget(shitlist,%mask)) { echo 2 -a * Error adding mask %mask to the shitlist: Mask is already shitlisted. }
    if (!$hget(shitlist,%mask)) { 
      if ($ial(%mask,0) >= 10) { echo 2 -a * Error adding mask %mask to the shitlist: There are too many ( $+ $ial(%mask,0) $+ ) users matching the mask. }
      if ($ial(%mask,0) < 10) {
      set %reason $$?"Reason to be shitlisted?" | hadd shitlist %mask Shitlisted: %reason | echo 2 -a * Added mask %mask to the shitlist. | kickchannels %mask %reason  }
    }
  }
  ..Del user:{
    var %mask $$?"Mask to be removed from shitlist"
    if (!$hget(shitlist,%mask)) { echo 2 -a * Error removing mask %mask from the shitlist: That mask is not shitlisted. }
    if ($hget(shitlist,%mask)) { hdel shitlist %mask | echo 2 -a * Mask %mask was succesfully removed from shitlist. }
  }
  ..Shitlist list:{
    if ($hfind(shitlist,*,0,w) == 0) { echo 2 -a * Error: Shitlist is empty. }
    if ($hfind(shitlist,*,0,w) > 0) {
      var %i = 1
      while (%i <= $hfind(shitlist,*,0,w)) {
        echo -a ID: ( $+ %i $+ ) Mask: $hfind(shitlist,*,%i,w) Reason: $hget(shitlist,$hfind(shitlist,*,%i,w)) 
        inc %i
      }
    }
  }
  ..Delete all shitlist entries:{
    if ($hfind(shitlist,*,0,w) == 0) { echo 2 -a * Error deleting all shitlisted masks: The shitlist is empty. }
    if ($hfind(shitlist,*,0,w) > 0) {
      echo 2 -a $hfind(shitlist,*,0,w) shitlisted entries will be removed.
      var %i = $hfind(shitlist,*,0,w)
      while (%i) {
        if ($hfind(shitlist,*,%i,w)) { var %rm = $hfind(shitlist,*,%i,w) | hdel shitlist $hfind(shitlist,*,%i,w) | echo 2 -a Removed shitlist entry: %rm }
        dec %i
      }
    }
  }
}
alias kickchannels { 
  if ($ial($1,0) == 0) { echo 2 -a * There are no masks mathing $1 on any channels. }
  if ($ial($1,0) > 0) {
    var %i $chan(0)
    while (%i) {
      var %x $nick($chan(%i),0)
      while (%x) {
        if ($1 iswm $address($nick($chan(%i),%x),5)) && ($me isop $chan(%i)) { mode $chan(%i) -o+b $nick($chan(%i),%x) $1 | kick $chan(%i) $nick($chan(%i),%x) Shitlisted: $2- | echo -a * ( $+ $date $+ ) ( $+ $time $+ ) $+ : Kicked shitlisted user ' $+ $nick($chan(%i),%x) $+ ' from $chan(%i) $+ .  }
        dec %x    
      }      
      dec %i
    }
  }
}
on *:join:#:{
  if ($hfind(shitlist,*,0,w) > 0) {
    var %i = $hfind(shitlist,*,0,w)
    while (%i) {
      if ($hfind(shitlist,*,%i,w) iswm $fulladdress) { mode $chan +b $hfind(shitlist,*,%i,w) | kick $chan $nick $hget(shitlist,$hfind(shitlist,*,%i,w)) | echo -a * ( $+ $date $+ ) ( $+ $time $+ ): Shitlisted user ' $+ $nick $+ ' joined $chan $+ . }
      dec %i
    }
  }
}

Comments

Sign in to comment.
xplo   -  May 08, 2008

/me will add a no-where comment here

 Respond  
Eugenio   -  May 07, 2008

lmfao

 Respond  
EL   -  May 07, 2008

lmfao der

 Respond  
juhapuha   -  May 07, 2008

The fuck*ing antibadlanguage thingie doesn\'t allow me to say that :(

 Respond  
EL   -  May 07, 2008

LAWL are you fellas tryin to say \"SHÍT\" or you just on crack?

 Respond  
juhapuha   -  May 06, 2008

Now i get what you were talking about :--P

 Respond  
juhapuha   -  May 06, 2008

nick shitbreak* i\'m too tired :(

 Respond  
juhapuha   -  May 06, 2008

LOL the author is me, but i just don\'t use the nick shitbreak here.. :D

 Respond  
^Neptune   -  May 06, 2008

hfsxyfgcssjgcybcaddsgf DAMNED TIDAL THING!

i officially hate auto spelling correctors

 Respond  
^Neptune   -  May 06, 2008

i was not messing around .. i was trying to say: Who is this author Shitbreak?

 Respond  
juhapuha   -  May 06, 2008

And i suggest to try it first before saying anything about it.

 Respond  
juhapuha   -  May 06, 2008

neptune wtf are you talking about? :o
i wanted to hear opinions about the script not messing around :]

 Respond  
Eugenio   -  May 06, 2008

lmfao neptune

 Respond  
^Neptune   -  May 06, 2008

ugh, forget it

delete those comments please

 Respond  
^Neptune   -  May 06, 2008

what I meant to say was: Author : Shitbreak

Damn auto spelling thing that i got >:O

 Respond  
^Neptune   -  May 06, 2008

Author : Shitbreak ;x

 Respond  
juhapuha   -  May 06, 2008

Comments please!

 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.