alias fldpro dialog -m fldpro fldpro
dialog fldpro {
  title "Flood Protection"
  size -1 -1 132 150
  option dbu

  tab "ctcp",1, 5 5 120 125
  tab "Message",2
  tab "control",3
  tab "Repeat",4

  button "&Ok",5,5 135 55 10,ok
  button "&Cancel",6,71 135 55 10,Cancel
  box "Ctcp Flood Control",7,15 20 100 100,,tab 1
  edit %ctcp.ctrl,8,95 35 15 10,autohs,,tab 1
  text "How Many Ctcps Before Any Action",9,20 35 50 20,,tab 1
  text "------>",10,70 37 20 14,,tab 1
  edit %ctcp.secs,11,95 55 15 10,autohs,,tab 1
  text "How Many Ctcp In   How Many Secs?",12,20 55 50 20,,tab 1
  text "------>",13,70 58 20 14,,tab 1
  edit %ctcp.ignore,14,95 75 15 10,autohs,,tab 1
  text "How Many Seconds    To Ignore Ctcps?",15,20 75 50 20,,tab 1
  text "------>",16,70 76 20 14,,tab 1
  button "on",17,30 98 30 12,,tab 1
  button "off",18,70 98 30 12,,tab 1

  box "Message Flood Control",19,15 20 100 100,,tab 2
  edit %msg.ctrl,20,95 35 15 10,autohs,,tab 2
  text "How Many Messages Before Any Action",21,20 35 56 20,,tab 2
  text "------>",22,76 37 20 14,,tab 2
  edit %msg.secs,23,95 55 15 10,autohs,,tab 2
  text "How Many Messages In How Many Secs?",24,20 55 54 20,,tab 2
  edit %msg.ignore,26,95 75 15 10,autohs,,tab 2
  text "How Many Seconds To Ignore Messages?",27,20 75 54 20,,tab 2
  text "------>",28,76 76 20 14,,tab 2
  button "on",29,30 98 30 12,,tab 2
  button "off",30,70 98 30 12,,tab 2

  box "Character Flood Control",31,15 20 100 100,,tab 3
  edit %textfloodtimes,32,95 35 15 10,autohs,,tab 3
  text "How Many Letters Before Kick?",33,20 35 56 20,,tab 3
  button "yes",34,75 55 15 10,,tab 3
  button "no",35,95 55 15 10,,tab 3
  button "yes",36,75 75 15 10,,tab 3
  button "no",37,95 75 15 10,,tab 3
  button "on",38,30 98 30 12,,tab 3
  button "off",39,70 98 30 12,,tab 3
  text "Kick Ops?",40,23 55 40 20,,tab 3
  text "---->",41,56 56 15 14,,tab 3
  text "Kick +v?",42,23 75 40 20,,tab 3
  text "---->",43,56 76 15 14,,tab 3

  box "Line Floods",44,15 20 100 65,,tab 4
  edit %linefloodtimes,45,95 30 15 10,autohs,,tab 4
  text "How Many Lines Before Kick?",46,20 30 56 20,,tab 4
  button "yes",47,75 44 15 10,,tab 4
  button "no",49,95 44 15 10,,tab 4
  button "yes",50,75 56 15 10,,tab 4
  button "no",51,95 56 15 10,,tab 4
  button "Turn on",52,20 70 40 10,,tab 4
  button "Turn off",53,70 70 40 10,,tab 4
  text "Kick Ops?",54,23 45 40 8,,tab 4
  text "---->",55,56 46 10 8,,tab 4
  text "Kick +v?",56,23 56 40 8,,tab 4
  text "---->",57,56 57 15 8,,tab 4
  box "Repeat Kick",58,15 85 100 42,,tab 4
  button "Turn on",59,20 93 40 10,,tab 4
  button "Turn off",60,70 93 40 10,,tab 4
  button "yes",61,75 105 15 8,,tab 4
  button "no",62,95 105 15 8,,tab 4
  button "yes",63,75 115 15 8,,tab 4
  button "no",64,95 115 15 8,,tab 4
  text "Kick Ops?  --->",65,30 105 40 8,,tab 4
  text "Kick +v? ------>",66,30 115 40 8,,tab 4
}
on *:dialog:fldpro:*:*:{
  if ($did == 8) { set %ctcp.ctrl $did(8).text | if ($did(8).text == $null) { set %ctcp.ctrl 4 } }
  if ($did == 11) { set %ctcp.secs $did(11).text | if ($did(11).text == $null) { set %ctcp.secs 10 } }
  if ($did == 14) { set %ctcp.ignore $did(14).text | if ($did(14).text == $null) { set %ctcp.ignore 30 } }
  if ($did == 17) { .enable #ctcp }
  if ($did == 18) { .disable #ctcp }
  if ($did == 20) { set %msg.ctrl $did(20).text | if ($did(20).text == $null) { set %msg.ctrl 4 } }
  if ($did == 23) { set %msg.secs $did(23).text | if ($did(23).text == $null) { set %msg.secs 10 } }
  if ($did == 26) { set %msg.ignore $did(26).text | if ($did(26).text == $null) { set %msg.ignore 30 } }
  if ($did == 29) { .enable #msgflood }
  if ($did == 30) { .disable #msgflood }
  if ($did == 32) { set %textfloodtimes $did(32).text | if ($did(32).text == $null) { set %textfloodtimes 400 } }
  if ($did == 34) { set %stop.1 yes }
  if ($did == 35) { set %stop.1 no }
  if ($did == 36) { set %stop.2 yes }
  if ($did == 37) { set %stop.2 no }
  if ($did == 38) { set %floodrepeatkick on }
  if ($did == 39) { set %floodrepeatkick off }
  if ($did == 45) { set %linefloodtimes $did(45).text | if ($did(45).text == $null) { set %linefloodtimes 5 } }
  if ($did == 47) { set %stop.3 yes }
  if ($did == 49) { set %stop.3 no }
  if ($did == 50) { set %stop.4 yes }
  if ($did == 51) { set %stop.4 no }
  if ($did == 52) { set %textrepeatkick on }
  if ($did == 53) { set %textrepeatkick off }
  if ($did == 59) { set %repeat on }
  if ($did == 60) { set %repeat off }
  if ($did == 61) { set %stop.5 yes }
  if ($did == 62) { set %stop.5 no }
  if ($did == 63) { set %stop.6 yes }
  if ($did == 64) { set %stop.6 no }
}
