Blacklist Script

By DarkCoder on Dec 09, 2009

This is another dialog that iv made :). The dark code blacklist :D. it works by finding an address and banning it, you can check the channel for blacklisted address via the right click button >Blacklist>Check Channel. Rate nicely please :D?

Added The Rest

on *:join:#: {
  if ($hget(Blacklist,$address($nick,3))) {
    if ($hget(Blacklist,kall)) || ($hget(Blacklist,$chan)) {
      if ($hget(blacklist,join)) alert Blacklisted Nick $+(-,$chr(40),$nick,$chr(41),-) has joined $chan
      if ($hget(Blacklist, opkick)) && ($me !isop $chan) halt
      if ($hget(Blacklist,ban)) mode $chan +b $address($nick,3)
      if ($hget(Blacklist,kick)) kcl $nick $chan $hget(Blacklist,message)
    }
  }
}
alias alert noop $tip(Blacklist,Blacklist Alert,$1-,9)
menu c* {
  -
  Blacklist
  .Settings:blistd
  .Check channel:bcheck $chan
  -
}
alias bcheck {
  var %x $nick($1,0)
  var %b 0
  while (%x) {
    if ($hget(Blacklist,$address($nick($1,%x),3))) {
      kcl $nick($1,%x) $1
      inc %b
      echo -a $nick($1,%x) has been found on the blacklist!
    }
    dec %x
  }
  echo -a Channel check complete - $iif(%b,$v1,0) Blacklisted nicks found.
}
alias kcl {
  if (Q !isin $chan($2).mode) kick $chan $1 $hget(Blacklist,message)
  else cs kick $chan $1 $hget(blacklist,message)
}
on *:load:blload
alias Blload {
  if (!$Hget(Blacklist)) hmake Blacklist 50
  if ($exist(blacklist.txt)) hload Blacklist Blacklist.txt
  hadd Blacklist message Blacklisted Nerd!
  hadd Blacklist opkick Blacklist
  $iif($?!"Do you want the guide to using this?",blhelp)
  echo -s You have successfully loaded the -DarkCode- Blacklist script.
  echo -s To use this script either type "/blistd" or right click the channel window.
}
alias blistd dialog -mo BlackSet BlackSet
dialog chbl {
  option dbu
  size -l -l 150 120
  title "-DarkCode- Blacklist Channel Settings"
  list 1, 5 75 140 50,vshbar
  edit "#", 2, 15 20 110 10, autohs
  button "Add Access Channel", 3, 15 10 110 10,
  text "Channels To Kick in", 4, 45 65 140 10,
  check "Kick in all Channels", 5, 5 50 60 10, flat
  check "Only kicked while opped", 6, 65 50 140 10, flat
  button "Remove Access Channel", 7, 15 30 110 10,
}
alias chblinit {
  did -ra chbl 1 Current Blacklist Channels
  var %x $hget(blacklist, 0).item
  while (%x) {
    if ($chr(35) isin $hget(blacklist, %x).item) did -a chbl 1 $hget(blacklist, %x).item
    dec %x
  }
  if ($hget(blacklist,kall)) did -c chbl 5
  if ($hget(blacklist,opkick)) did -c chbl 6
}
on *:dialog:chbl:*:*: {
  if ($devent == init) chblinit
  if ($devent == sclick) {
    if ($did == 3) {
      if ($chr(35) isin $did(2).text) && (@ !isin $did(2).text) {
        hadd Blacklist $did(2).text Blacklist
        chblinit
      }
      else {
        berror You can only enter channels!
        echo -a $did(2).text
        did -ra $dname 2 $chr(35)
      }
    }
    if ($did == 7) { 
      if ($did(1).seltext) && ($chr(35) isin $did(1).seltext) hdel blacklist $did(1).seltext Blacklist
      else berror You have not selected a channel to be deleted
      chblinit    
    }
    if ($did == 5) $+(h,$iif($did(5).state,add,del)) Blacklist kall Blacklist
    if ($did == 6) $+(h,$iif($did(5).state,add,del)) Blacklist opkick Blacklist
  }
  if ($devent == close) hsave blacklist blacklist.txt
}
alias blhelp {
  window -c @Blacklist
  window -da @Blacklist
  echo 12 @Blacklist -4DarkCode12-
  echo @Blacklist First thing is first, type "/blistd" or right click a channel for the blacklist settings.
  echo @Blacklist To use the script first go to channel control. Either click, Kick in all channels, or click, Add Channel - You must first input a channel into the box -
  echo @Blacklist After this you add a nick to the blacklist or address. If a nick is specified it will find the address of the nick and if it is found it will be added.
  echo @Blacklist Once a nick is added you check the "Kick on join" spot and if you want to ban, the "ban on join" spot. For it to echo to this window when a blacklisted nick joins
  echo @Blacklist Check the "Show Blacklisted joins" spot. - To edit the message when you kick a blacklisted nick, enter the message into the "Kick message" box and it will be used.
  echo @Blacklist - Note - When adding an address in the "add to blacklist" slot, make sure it is in $+($,address) 3 form.
}
dialog Blackset {
  option dbu
  size -l -l 190 150
  Title "-DarkCode- Blacklist Main Settings"
  list  1, 5 100 170 50, vshbar
  text "Current Blacklist", 2, 60 90 50 10,
  edit "", 3, 30 20 110 10,autohs
  button "Add To Blacklist", 4, 35 10 50 10, disabled
  button "Remove Blacklist", 5, 85 10 50 10, disabled
  edit "Blacklisted Nerd!" 7, 5 65 50 10, autohs
  text "Kick Message" 8, 15 55 50 10,
  check "Show Blacklisted Joins" 9, 105 35 70 10,
  check "Kick on join" 10, 5 35 40 10,
  check "Ban on join" 11, 55 35 40 10,
  box "Other Blacklist Dialogs", 12, 70 45 90 40,
  button "Channel Control", 13, 75 53 80 15
  button "Blacklist Help", 14, 75 68 80 15
}
on *:dialog:blackset:sclick:*: {
  if ($did == 13) dialog -mo Chbl chbl
  if ($did == 14) blhelp
  if ($did == 9) {
    if ($did(9).state) { 
      Hadd Blacklist join Do
    }
    else { 
      hdel Blacklist join Do
    }
  }
  if ($did == 10) {
    if ($did(10).state) { 
      Hadd Blacklist kick Do
    }
    else { 
      hdel Blacklist kick Do
    }
  }
  if ($did == 11) {
    if ($did(11).state) { 
      Hadd Blacklist ban Do
    }
    else { 
      hdel Blacklist ban Do
    }
  }
  if ($did == 4) {
    if (@ isin $did(3).text) {
      hadd Blacklist $did(3).text Blacklist
      bstart
    }
    elseif ($address($did(3).text,3)) { hadd Blacklist $address($did(3).text,3) Blacklist | bstart }
    elseif (!$address($did(3).text,3)) && (@ !isin $did(3).text) {
      did -b $dname 4
      did -ra $dname 3 Address for $did(3).text not found! Please try again.
    }
  }
  if ($did == 1) did -e $dname 5
  if ($did == 5) {
    if ($hget(Blacklist,$did(1).seltext).item) { 
      hdel Blacklist $did(1).seltext Blacklist
      bstart
    }
    else berror No nick has been specified.
  }
}
alias berror noop $input($1-,Blacklist Error,$1-,Blacklist Error)
on *:dialog:blackset:edit:*: {
  if ($did == 3) && ($len($did(3).text) >= 1) && ($chr(32) !isin $did(3).text) { did -e $dname 4 }
  else did -b $dname 4
  if ($did == 7) { Hdel Blacklist Message * | hadd Blacklist message $did(7).text }
}
on *:dialog:blackset:init:*: Bstart
on *:dialog:blackset:close:*: hsave Blacklist Blacklist.txt
alias bstart {
  did -ra Blackset 1 Current Blacklisted Addresses
  if (!$hget(Blacklist)) hmake blacklist 50
  if ($exist(blacklist.txt)) hload Blacklist Blacklist.txt
  did -ra Blackset 7 $hget(Blacklist, Message)
  did $+(-,$iif($hget(blacklist,kick),c,u)) Blackset 10
  did $+(-,$iif($hget(blacklist,join),c,u)) Blackset 9
  did $+(-,$iif($hget(blacklist,ban),c,u)) Blackset 11
  var %x $hget(Blacklist, 0).item
  while (%x) {
    if (@ isin $hget(blacklist, %x).item) did -a $dname 1 $hget(Blacklist, %x).item
    dec %x
  }
}

Comments

Sign in to comment.
L0ckp1ck   -  Mar 03, 2010

cracker200 aka shanker is a lamer bot flooder on ircqnet.

More
 Respond  
Ghost-writer   -  Dec 18, 2009

good job :|?

More
 Respond  
Cracker200   -  Dec 10, 2009

6/10

More
 Respond  
Cracker200   -  Dec 10, 2009

Nice.

More
 Respond  
DarkCoder   -  Dec 10, 2009

Napa, I added the rest, re-rate/comment please :D?

More
 Respond  
napa182   -  Dec 09, 2009

seems like ur missing a few things =/

More
 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.