Bad Channel WITH Dialog

By xplo on Sep 18, 2008

This Code was made by napa but it was a bad words dialog, he modified it to make a bad channel script. and i appreciate it a lot. :p

Enjoy
Image

dialog BD { 
  title "Bad Channel Dialog" 
  size -1 -1 129 87 
  option dbu 
  box "Add/Rem Channnel's", 1, 2 2 67 31 
  edit "", 2, 3 10 64 9 
  button "Add", 3, 3 21 32 10, flat 
  button "Remove", 4, 35 21 32 10, flat 
  box "Channel List", 5, 70 2 57 31 
  list 6, 71 10 54 21, size vsbar 
  box "Add/Rem Bad Channels", 7, 2 34 67 31 
  edit "", 8, 3 42 64 9, autohs 
  button "Add", 9, 3 53 32 10, flat 
  button "Remove", 10, 35 53 32 10, flat 
  box "Bad Chan List", 11, 70 34 57 31 
  list 12, 71 42 54 21, size vsbar 
  box "Power On/Off ", 13, 2 67 47 18 
  radio "ON", 14, 4 75 18 9, flat 
  radio "OFF", 15, 28 75 20 9, flat 
  box "Log", 16, 50 67 77 18 
  check "OFF", 17, 52 75 20 9, flat 
  check "P2P", 18, 74 75 20 9, flat 
  check "Window", 19, 96 75 30 9, flat 
} 
menu menubar,channel { 
  .Bad Channel Dialog:{ dialog $iif($dialog(BD),-v,-md) BD BD } 
} 
on *:DIALOG:BD:init:0:{ 
  $iif(%badc,did -c $dname 14,did -c $dname 15) 
  $iif(%bdlog.p2p,did -c $dname 18,$iif(%bdlog.win,did -c $dname 19,$iif(!%bdlog.*,did -c $dname 17))) 
  didtok $dname 6 44 %Rchan 
  didtok $dname 12 44 %badchan 
}  
on *:DIALOG:BD:sclick:*:{ 
  if ($did == 14) { set %badc on } 
  if ($did == 15) { unset %badc } 
  if ($did == 17) { unset %bdlog.* | did -u $dname 18,19 | did -c $dname  17 } 
  if ($did == 18) { set %bdlog.p2p on | unset %bdlog.win | did -u $dname 17,19 | did -c $dname 18 } 
  if ($did == 19) { set %bdlog.win on | unset %bdlog.p2p | did -u $dname 17,18 | did -c $dname 19 } 
  if ($did == 3) { 
    if (!$did(2).text || $left($did(2).text,1) != $chr(35) || $istok(%Rchan,$did(2).text,44)) { 
      noop $iif(!$did(2).text,$input(No Channel Was Entered,uwo,Error!),$iif($left($did(2).text,1) != $chr(35),$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($istok(%Rchan,$did(2).text,44),$input(Channel Already Exists,uwo,Error!),))) 
      did -r $dname 2 
    } 
    else { 
      set %Rchan $addtok(%Rchan,$did(2).text,44) 
      did -r $dname 6,2 
      didtok $dname 6 44 %Rchan 
    } 
  } 
  if ($did == 4) { 
    if (!$did(2).text && !$did(6).seltext || $left($did(2).text,1) != $chr(35) && !$did(6).seltext || $did(2).text && !$did(6).seltext && !$istok(%Rchan,$did(2).text,44)) { 
      noop $iif(!$did(2).text && !$did(6).seltext,$input(No Channel Was Entered Or Selected,uwo,Error!),$iif($left($did(2).text,1) != $chr(35) && !$did(6).seltext,$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($did(2).text && !$did(6).seltext && !$istok(%Rchan,$did(2).text,44),$input(Channel Does Not Exists,uwo,Error!),))) 
      did -r $dname 2 
    } 
    elseif ($did(2).text && !$did(6).seltext && $istok(%Rchan,$did(2).text,44)) { 
      set %Rchan $remtok(%Rchan,$did(2).text,1,44) 
      did -r $dname 6,2 
      didtok $dname 6 44 %Rchan 
    } 
    elseif ($did(6).seltext && !$did(2).text) { 
      set %Rchan $remtok(%Rchan,$did(6).seltext,1,44) 
      did -r $dname 6,2 
      didtok $dname 6 44 %Rchan 
    } 
  } 
  if ($did == 9) { 
    if (!$did(8).text || $left($did(8).text,1) != $chr(35) || $istok(%badchan,$did(8).text,44)) { 
      noop $iif(!$did(8).text,$input(No Channel Was Entered,uwo,Error!),$iif($left($did(8).text,1) != $chr(35),$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($istok(%badchan,$did(8).text,44),$input(Channel Already Exists,uwo,Error!),))) 
      did -r $dname 8 
    } 
    else { 
      set %badchan $addtok(%badchan,$did(8).text,44) 
      did -r $dname 8,12 
      didtok $dname 12 44 %badchan 
    } 
  } 
  if ($did == 10) { 
    if (!$did(8).text && !$did(12).seltext || $left($did(8).text,1) != $chr(35) && !$did(12).seltext || $did(8).text && !$did(12).seltext && !$istok(%badchan,$did(8).text,44)) { 
      noop $iif(!$did(8).text && !$did(12).seltext,$input(No Channel Was Entered Or Selected,uwo,Error!),$iif($left($did(8).text,1) != $chr(35) && !$did(12).seltext,$input(Please Enter Channel As Syntax: #channel,uwo,Syntax Error!),$iif($did(8).text && !$did(12).seltext && !$istok(%banchan,$did(8).text,44),$input(Channel Does Not Exists,uwo,Error!),))) 
      did -r $dname 8 
    } 
    elseif ($did(8).text && !$did(12).seltext && $istok(%badchan,$did(8).text,44)) { 
      set %badchan $remtok(%badchan,$did(8).text,1,44) 
      did -r $dname 8,12 
      didtok $dname 12 44 %badchan 
    } 
    elseif ($did(12).seltext && !$did(8).text) { 
      set %badchan $remtok(%badchan,$did(12).seltext,1,44) 
      did -r $dname 8,12 
      didtok $dname 12 44 %badchan 
    } 
  } 
}    
on !@*:join:#:{ if (%badc && $istok(%Rchan,$chan,44)) { whois $nick | set -u5 %achan $chan } } 
raw *:*: { 
  if (!%who1) { 
    if ($istok(311 379 378 307 312 317 318,$numeric,32)) { haltdef } 
    if ($numeric == 319) { 
      haltdef 
      var %a = $replace($remove($3-,&,+,%,@,~,!,?),$chr(32),$chr(44)), %x = $numtok(%a,44) 
      while (%x) { 
        if ($istok(%badchan,$gettok(%a,%x,44),44)) { 
          ban -ku300 %achan $2 2 Bad Channel Detected 
          if (%bdlog.p2p) { .msg $me $2 Was Banned For Bad Channel In Room %achan Date/Time $time(mmm dd h:nn tt) Bad Channel: $gettok(%a,%x,44) } 
          if (%bdlog.win) { window @Bad_Channel_Dialog | aline @Bad_Channel_Dialog $2 Was Banned For Bad Channel In Room %achan Date/Time $time(mmm dd h:nn tt) Bad Channel: $gettok(%a,%x,44) } 
        } 
        dec %x 
      } 
    } 
  } 
}

Comments

Sign in to comment.
RameeX   -  Aug 10, 2010

Ur addon is awesome but fix this problem please.

 Respond  
RameeX   -  Aug 10, 2010

Ur addon stoped my /whois and right click popup whois.. i can't whois any user :(

 Respond  
EL   -  Sep 18, 2008

;o!

 Respond  
napa182   -  Sep 18, 2008

um one list box is for the channels you want to run this script on and the other is for the bad channels cuz most people dont like to run it in every room they are in, and the channels you add to use this on do come up on the init event as well as the badchannels.

oh and Xpl0reR you can remove the if (!%who1) { line on the raw's remember that sets from another one of ur scripts. Or it did till i changed it to use groups.

 Respond  
PuNkTuReD   -  Sep 18, 2008

nice, would be nice if the available channels get auto put in on init

 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.