Text Flood Protection Dialog

By napa182 on Aug 04, 2008

just an ez text flood protection dialog for protecting rooms from text flooders. copy paste into a new remote and either click on ur menubar or in a channel to open. then set it up with the channels you want to protect and the number of seconds and amount of lines of text to kick/ban on..
enjoy..
feel free to rip butcher and strip this code how ever you want idc
ok i changed it so you can add a banmask for the ban and also you can have it either just kick users or set it to kick/ban and also add how many times to warn before it kicks or kick/ban's if you want to warn.

Image

updated to kick/ban on user mode's +o +h +v
i still have it to kick/ban reg users but you can now have it kick/ban +o +h and +v users.

dialog doz {
  title "Room Flood Protection"
  size -1 -1 121 94
  option dbu
  box "Add/Remove Channel", 1, 2 2 61 29
  edit "", 2, 3 10 58 9, autohs
  button "Add", 3, 3 20 28 9, flat
  button "Remove", 4, 33 20 28 9, flat
  box "Channel List", 5, 65 2 54 29
  list 6, 66 10 51 19, size vsbar
  box "Set Second's", 7, 2 32 38 19
  edit "", 8, 3 40 15 9, autohs center
  button "Set", 9, 19 40 19 9, flat
  box "Set Line", 10, 41 32 38 19
  edit "", 11, 42 40 15 9, autohs center
  button "Set", 12, 58 40 19 9, flat
  box "Power", 13, 80 32 39 19
  radio "on", 14, 82 40 16 9
  radio "off", 15, 101 40 17 9
  box "Set Banmask", 16, 2 52 38 19
  edit "", 17, 3 60 15 9, autohs center
  button "Set", 18, 19 60 19 9, flat
  box "Function's", 19, 41 52 78 19
  check "Kick", 20, 43 60 19 9
  check "KBan", 21, 63 60 22 9
  check "Warning", 22, 86 60 31 9
  box "Set Warn amount", 23, 65 73 54 19
  edit "", 24, 67 81 17 9, autohs center
  button "Set", 25, 85 81 32 9, flat
  box "Kick on user mode's", 26, 2 73 61 19
  check "+o", 27, 4 81 18 9
  check "+h", 28, 24 81 18 9
  check "+v", 29, 44 81 18 9
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's Room Flood Protection Dialog 
  echo 12 -a A Script0rs Inc. Production 
  set %bmask 4
  set %sec 2
  set %line 5
  set %fkban on
  echo -a 14,1(14,1¯15,1¯0,1¯0,1º $+($chr(171),$chr(164),$chr(88),$chr(167),$chr(199),$chr(174),$chr(238),$chr(254),$chr(116),$chr(48),$chr(174),$chr(167),$chr(88),$chr(164),$chr(187)) º0,1¯15,1¯14,1¯) $+ $chr(153)
}
alias doz { dialog $iif($dialog(doz),-v,-mied) doz doz }
menu menubar,channel {
  .Room Flood Protection:{ doz }
}
on *:DIALOG:doz:init:0:{
  $iif(%warn,did -c $dname 22,did -u $dname 22)
  $iif(!%warn,did -b $dname $+(24,$chr(44),25),did -e $dname $+(24,$chr(44),25))
  $iif(%rfpd,did -c $dname 14,did -c $dname 15)
  $iif(%fkick,did -c $dname 20,$iif(%fkban,did -c $dname 21,)) 
  if (%y.o) { did -c $dname 27 }
  if (%y.h) { did -c $dname 28 }
  if (%y.v) { did -c $dname 29 }
  did -b $dname 3,4
  did -a $dname 17 %bmask
  did -a $dname 24 %numwarn
  did -a $dname 8 %sec
  did -a $dname 11 %line
  didtok $dname 6 44 %rfloodchan
}
on *:DIALOG:doz:edit:*:{
  $iif($did(2).text,did -e $dname $+(3,$chr(44),4),did -b $dname $+(3,$chr(44),4))
  $iif($did(8).text,did -e $dname 9,did -b $dname 9)
  $iif(!$did(11).text,did -b $dname 12,did -e $dname 12)
  $iif(!$did(17).text,did -b $dname 18,did -e $dname 18)
}
on *:DIALOG:doz:sclick:*:{
  if ($did == 6) { did -e $dname 4 }
  $iif($did(22).state == 0,unset %warn,set %warn on)
  $iif($did(22).state == 1,did -e $dname $+(24,$chr(44),25),did -b $dname $+(24,$chr(44),25))
  if ($did == 14) { set %rfpd on }
  if ($did == 15) { unset %rfpd }
  if ($did == 20) { set %fkick on | unset %fkban | did -c $dname 20 | did -u $dname 21 }
  if ($did == 21) { set %fkban on | unset %fkick | did -c $dname 21 | did -u $dname 20 }
  $iif($did(27).state == 0,unset %y.o,set %y.o on) 
  $iif($did(28).state == 0,unset %y.h,set %y.h on)
  $iif($did(29).state == 0,unset %y.v,set %y.v on)
  if ($did == 25) {
    if ($did(24).text !isnum 1-5) { noop $input(Please Enter Number Of Warnings 1-5,uwo,Error!) | did -r $dname 24 }
    else { set %numwarn $did(24).text }
  }
  if ($did == 18) {
    if ($did(17).text !isnum 0-9) { noop $input(Please Enter The Banmask Number to use 0-9,uwo,Error!) | did -r $dname 17 }
    else { set %bmask $did(17).text }
  }
  if ($did == 3) {
    if (!$did(2).text || $left($did(2).text,1) != $chr(35) || $istok(%rfloodchan,$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(%rfloodchan,$did(2).text,44),$input(Channel Already Exists,uwo,Error!),)))
      did -r $dname 2
    }
    else { 
      set %rfloodchan $addtok(%rfloodchan,$did(2).text,44)
      did -r $dname 6,2
      didtok $dname 6 44 %rfloodchan
    }
  }
  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(%rfloodchan,$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(%rfloodchan,$did(2).text,44),$input(Channel Does Not Exists,uwo,Error!),)))
      did -r $dname 2 
    }
    elseif ($did(2).text && !$did(6).seltext && $istok(%rfloodchan,$did(2).text,44)) {
      set %rfloodchan $remtok(%rfloodchan,$did(2).text,1,44)
      did -r $dname 6,2
      didtok $dname 6 44 %rfloodchan
    }
    elseif ($did(6).seltext && !$did(2).text) {
      set %rfloodchan $remtok(%rfloodchan,$did(6).seltext,1,44)
      did -r $dname 6,2
      didtok $dname 6 44 %rfloodchan
    }
  }
  if ($did == 9) { 
    if ($did(8).text !isnum) { noop $input(Please Enter Number Of Second's,uwo,Error!) }
    else { set %sec $did(8).text }
  }
  if ($did == 12) { 
    if ($did(11).text !isnum) { noop $input(Please Enter Number Of Text Lines,uwo,Error!) }
    else { set %line $did(11).text }
  }
}
on @*:text:*:#: {
  if (%rfpd && $istok(%rfloodchan,$chan,44) && $nick(#,$nick,$+(r,$iif(%y.v,v,$iif(%y.h,h,$iif(%y.o,o,)))))) { 
    inc -u $+ %sec $+(%,flood,.,$chan,.,$nick)
    if ($($+(%,flood,.,$chan,.,$nick),2) >= %line ) {
      if (%warn) {
        inc -u300 $+(%,warn,$chan,$nick)
        if ($($+(%,warn,$chan,$nick),2) <= %numwarn) { .notice $nick Please Dont Flood This Room }
        if ($($+(%,warn,$chan,$nick),2) > %numwarn) {
          $iif(%fkick,kick # $nick No Flooding In This Room.,ban -ku600 # $nick %bmask No Flooding In This Room.)
          unset $+(%,warn,$chan,$nick)
        }
      }
      else { $iif(%fkick,kick # $nick No Flooding In This Room.,ban -ku600 # $nick %bmask No Flooding In This Room.) }
    }
  }
}
on @*:notice:*:#: {
  if (%rfpd && $istok(%rfloodchan,$chan,44) && $nick(#,$nick,$+(r,$iif(%y.v,v,$iif(%y.h,h,$iif(%y.o,o,)))))) { 
    inc -u $+ %sec $+(%,flood,.,$chan,.,$nick)
    if ($($+(%,flood,.,$chan,.,$nick),2) >= %line ) {
      if (%warn) {
        inc -u300 $+(%,warn,$chan,$nick)
        if ($($+(%,warn,$chan,$nick),2) <= %numwarn) { .notice $nick Please Dont Notice Flood This Room }
        if ($($+(%,warn,$chan,$nick),2) > %numwarn) {
          $iif(%fkick,kick # $nick No Notice Flooding In This Room.,ban -ku600 # $nick %bmask No Notice Flooding In This Room.)
          unset $+(%,warn,$chan,$nick)
        }
      }
      else { $iif(%fkick,kick # $nick No Notice Flooding In This Room.,ban -ku600 # $nick %bmask No Notice Flooding In This Room.) }
    }
  }
}
on @*:action:*:#: {
  if (%rfpd && $istok(%rfloodchan,$chan,44) && $nick(#,$nick,$+(r,$iif(%y.v,v,$iif(%y.h,h,$iif(%y.o,o,)))))) { 
    inc -u $+ %sec $+(%,flood,.,$chan,.,$nick)
    if ($($+(%,flood,.,$chan,.,$nick),2) >= %line ) {
      if (%warn) {
        inc -u300 $+(%,warn,$chan,$nick)
        if ($($+(%,warn,$chan,$nick),2) <= %numwarn) { .notice $nick Please Dont Action Flood This Room }
        if ($($+(%,warn,$chan,$nick),2) > %numwarn) {
          $iif(%fkick,kick # $nick No Action Flooding In This Room.,ban -ku600 # $nick %bmask No Action Flooding In This Room.)
          unset $+(%,warn,$chan,$nick)
        }
      }
      else { $iif(%fkick,kick # $nick No Action Flooding In This Room.,ban -ku600 # $nick %bmask No Action Flooding In This Room.) }
    }
  }
}

Comments

Sign in to comment.
napa182   -  Feb 23, 2010

@Meow this snippet is abit old but still works. make sure you are +o in the chan you run this in.

when i get time il prob update this

 Respond  
Meow   -  Feb 23, 2010

Ok When I click +op for the kick on user mode's it doesn't work. And how can I get a flood protection thing that kicks everyone but owners.

 Respond  
PuNkS   -  Dec 29, 2009

nice..
:)

 Respond  
baseballer790   -  Feb 08, 2009

Pretty good. Needs some new features though..Like timed bans, and maybe kick 3 times...then ban?

 Respond  
napa182   -  Oct 10, 2008

thank you.

 Respond  
Paul_1337noob   -  Oct 10, 2008

very nice napa

 Respond  
napa182   -  Oct 10, 2008

Ok I added that to it.
I still have it to kick/ban reg users but you can now have it kick/ban +o +h and +v users.

 Respond  
napa182   -  Oct 10, 2008

um sure i guess i could do that.. il do that when i get some time.

 Respond  
DarkRaviel   -  Aug 30, 2008

could you update it with an option button for punishing or not voiced users?
nice coding btw..

 Respond  
EL   -  Aug 11, 2008

Updates look good Steve.Like the presets to;p.Nice dialog as well dotn liesten to the boy hes a dumb shit.And maybe add a close button to it.`-.-´

 Respond  
Eugenio   -  Aug 05, 2008

lol nice code Napa :p
I dont like the buttons......but still nice code -.-
/me rates 8

 Respond  
napa182   -  Aug 05, 2008

LMFAO so true

 Respond  
EL   -  Aug 05, 2008

lol yeah OPs should be flooding should make it auto deop them for like an hour rofl and mute them ;p BAD OPS BAD

 Respond  
napa182   -  Aug 05, 2008

well of corse it wont ban op\'s only voice and reg users =P .. ah true well il add more on to it later ..

 Respond  
EL   -  Aug 05, 2008

Rofl@description so true ;p and yeah should maybe tell ppl that it doesnt kickban OPS ;p othe rthen that works great.Suggestions i know its a small script but maybe ban times and ban mask choice.`-.-´

 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.