Docstoc

Text Flood Protection Dialog

Document Sample
Text Flood Protection Dialog Powered By Docstoc
					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(1
87)) ? 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.) }
    }
  }
}

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:11/1/2012
language:
pages:4