;-=-=-=-=-=-
; DeadLy Script - chan PROTECT
;-=-=-=-=-=-
dialog protek {
  title Channel Protection/Options - $sc
  size -1 -1 540 330
  icon $icons(pro)
  list 1, 10 290 43 32, size
  list 2, 55 290 43 32, size
  list 3, 110 290 43 32, size
  button d&efault, 43, 425 295 45 25, default
  button &close, 36, 480 295 50 25, cancel

  tab Protection, 1001, 10 10 400 280
  check text repeat, 101, 30 50 100 20, tab 1001
  check text flood, 102, 30 70 100 20, tab 1001
  check excess chars, 103, 30 90 100 20, tab 1001
  check excess CAPS, 104, 30 110 100 20, tab 1001
  check excess colors, 105, 30 130 100 20, tab 1001
  check excess codes, 106, 30 150 100 20, tab 1001
  check guest nick, 107, 30 190 100 20, tab 1001
  check bad nick, 108, 30 210 100 20, tab 1001
  check bad host/idents, 109, 30 230 100 20, tab 1001
  check bad channel, 110, 30 250 100 20, tab 1001
  button !, 201, 130 50 18 18, tab 1001
  button ! , 202, 130 70 18 18, tab 1001
  button ! , 203, 130 90 18 18, tab 1001
  button ! , 204, 130 110 18 18, tab 1001
  button ! , 205, 130 130 18 18, tab 1001
  button ! , 206, 130 150 18 18, tab 1001
  button ! , 207, 130 190 18 18, tab 1001
  button ! , 208, 130 210 18 18, tab 1001
  button ! , 209, 130 230 18 18, tab 1001
  button ! , 210, 130 250 18 18, tab 1001
  check quit/part ads, 111, 170 50 100 20, tab 1001
  check mass kick, 112, 170 70 100 20, tab 1001
  check mass ban, 113, 170 90 100 20, tab 1001
  check mass de@p, 114, 170 110 100 20, tab 1001
  check forbidden words, 115, 170 150 100 20, tab 1001
  check chan/site ads, 116, 170 170 100 20, tab 1001
  check onJoin spam, 117, 170 190 100 20, tab 1001
  check revolving door, 118, 170 210 100 20, tab 1001
  check idle nick, 119, 170 230 100 20, tab 1001
  check clone limit, 120, 170 250 100 20, tab 1001
  button !, 211, 270 50 18 18, tab 1001
  button ! , 212, 270 70 18 18, tab 1001
  button ! , 213, 270 90 18 18, tab 1001
  button ! , 214, 270 110 18 18, tab 1001
  button ! , 215, 270 150 18 18, tab 1001
  button ! , 216, 270 170 18 18, tab 1001
  button ! , 217, 270 190 18 18, tab 1001
  button ! , 218, 270 210 18 18, tab 1001
  button ! , 219, 270 230 18 18, tab 1001
  button ! , 220, 270 250 18 18, tab 1001
  combo  401, 295 70 110 100, tab 1001 drop sort
  text Ban type, 4, 297 57 100 14, tab 1001
  text Click 'button !' to see more options, 5, 300 240 100 40, tab 1001
  text temporary ban (secs) :, 34, 300 127 100 14, tab 1001
  edit "",  527, 295 140 35 20, tab 1001
  text warning kick msg, 35, 300 167 100 14, tab 1001 
  edit "",  528, 295 180 110 20, tab 1001 autohs

  tab Options, 1002

  box When joining channel, 6, 30 40 350 120, tab 1002
  box Nick action, 7, 30 160 350 110, tab 1002
  check set modes, 121, 50 60 100 20, tab 1002
  check set topic, 122, 50 80 100 20, tab 1002
  check say, 123, 50 100 100 20, tab 1002
  check deop yourself, 124, 50 120 100 20, tab 1002
  check auto greet, 125, 50 180 100 20, tab 1002
  check auto farewell, 126, 50 200 100 20, tab 1002
  check whois onJoin, 127, 50 220 100 20, tab 1002
  check kick IRCOP, 131, 50 240 100 20, tab 1002
  edit "", 501, 150 60 80 20, tab 1002 
  edit "", 502, 150 80 210 20, tab 1002 autohs
  edit "", 503, 150 100 210 20, tab 1002 autohs
  edit "", 504, 150 180 210 20, tab 1002autohs
  edit "", 505, 150 200 210 20, tab 1002 autohs
  edit "", 529, 150 240 210 20, tab 1002 autohs

  tab Kick Msg1, 1003

  box protection, 9, 30 40 100 240, tab 1003 
  box kick msg, 10, 130 40 250 240, tab 1003
  text text repeat, 11, 50 63 70 14, tab 1003 right
  text text flood, 12, 50 83 70 14, tab 1003 right
  text excess chars, 13, 50 103 70 14, tab 1003 right
  text excess CAPS, 14, 50 123 70 14, tab 1003 right
  text excess colors, 15, 50 143 70 14, tab 1003 right
  text excess codes, 16, 50 163 70 14, tab 1003 right
  text guest nick, 17, 50 183 70 14, tab 1003 right
  text bad nick, 18, 50 203 70 14, tab 1003 right
  text bad host/idents, 19, 40 223 80 14, tab 1003 right
  text bad channel, 20, 50 243 70 14, tab 1003 right
  edit "", 506, 150 60 210 20, tab 1003 autohs
  edit "", 507, 150 80 210 20, tab 1003 autohs
  edit "", 508, 150 100 210 20, tab 1003 autohs
  edit "", 509, 150 120 210 20, tab 1003 autohs
  edit "", 510, 150 140 210 20, tab 1003 autohs
  edit "", 511, 150 160 210 20, tab 1003 autohs
  edit "", 512, 150 180 210 20, tab 1003 autohs
  edit "", 513, 150 200 210 20, tab 1003 autohs
  edit "", 514, 150 220 210 20, tab 1003 autohs
  edit "", 515, 150 240 210 20, tab 1003 autohs

  tab Kick Msg2, 1004

  box protection, 21, 30 40 100 240, tab 1004
  box kick msg, 22, 130 40 250 240, tab 1004
  text quit/part ads, 23, 50 63 70 14, tab 1004 right
  text mass kick, 24, 50 83 70 14, tab 1004 right
  text mass ban, 25, 50 103 70 14, tab 1004 right
  text mass de@p, 26, 50 123 70 14, tab 1004 right
  text forbidden words, 27, 40 143 80 14, tab 1004 right
  text chan/site ads, 28, 50 163 70 14, tab 1004 right
  text onJoin spam, 29, 50 183 70 14, tab 1004 right
  text Revolving door, 30, 40 203 80 14, tab 1004 right
  text idle nick, 31, 40 223 80 14, tab 1004 right
  text clone limit, 32, 50 243 70 14, tab 1004 right
  edit "", 516, 150 60 210 20, tab 1004 autohs
  edit "", 517, 150 80 210 20, tab 1004 autohs
  edit "", 518, 150 100 210 20, tab 1004 autohs
  edit "", 519, 150 120 210 20, tab 1004 autohs
  edit "", 520, 150 140 210 20, tab 1004 autohs
  edit "", 521, 150 160 210 20, tab 1004 autohs
  edit "", 522, 150 180 210 20, tab 1004 autohs
  edit "", 523, 150 200 210 20, tab 1004 autohs
  edit "", 524, 150 220 210 20, tab 1004 autohs
  edit "", 525, 150 240 210 20, tab 1004 autohs

  tab Extra, 1005

  text using, 37, 180 63 120 14 , tab 1005
  text (#n replace kick number), 40, 280 63 120 14 , tab 1005
  text This Channel Protection option is created by the author and used less millitant penalty. It is in your choice to configure the options., 41, 220 230 180 50 , wrap tab 1005
  text Channel POPUPS Warning Msg:, 42, 30 183 240 14, tab 1005
  check Use kick counter, 132, 30 60 100 20, tab 1005
  check Filter kick (kick banned nicks), 133, 30 90 180 20, tab 1005
  check Warn when your nick is mentioned, 134, 30 120 190 20, tab 1005
  check Detect nick change, 135, 30 150 115 20, tab 1005
  edit "", 530, 135 60 40 20, autohs tab 1005
  edit "", 531, 210 60 60 20, autohs tab 1005
  edit "", 532, 190 180 160 20, autohs tab 1005

  text only in channels: (clear all if to all chan), 8, 425 15 110 28 
  text kick logo, 33, 253 288 120 14 
  edit "", 526, 250 300 150 20, autohs
  list 301, 420 40 110 140, sort
  button &add, 302, 425 170 45 18
  button &del, 303, 480 170 45 18
  check exclude ops, 128, 420 200 100 20
  check exclude voice, 129, 420 220 100 20
  check exclude friends, 130, 420 240 100 20
  list 901, 510 240 28 12
}
on 1:dialog:protek:*:*: {
  if $devent = init { init1 }
  if $devent = sclick { 
    pro.chk 101 chk1
    pro.chk 102 chk2
    pro.chk 103 chk3
    pro.chk 104 chk4
    pro.chk 105 chk5
    pro.chk 106 chk6
    pro.chk 107 chk7
    pro.chk 108 chk8
    pro.chk 109 chk9
    pro.chk 110 chk10
    pro.chk 111 chk11
    pro.chk 112 chk12
    pro.chk 113 chk13
    pro.chk 114 chk14
    pro.chk 115 chk15
    pro.chk 116 chk16
    pro.chk 117 chk17
    pro.chk 118 chk18
    pro.chk 119 chk19
    pro.chk 120 chk20
    pro.chk 121 chk21
    pro.chk 122 chk22
    pro.chk 123 chk23
    pro.chk 124 chk24
    pro.chk 125 chk25
    pro.chk 126 chk26
    pro.chk 127 chk27
    pro.chk 128 chk28
    pro.chk 129 chk29
    pro.chk 130 chk30
    pro.chk 131 chk31
    pro.chk 132 chk32
    pro.chk 133 chk33
    pro.chk 134 chk34
    pro.chk 135 chk35
    pro.but 201 pro1
    pro.but 202 pro2
    pro.but 203 pro3
    pro.but 204 pro4
    pro.but 205 pro5
    pro.but 206 pro6
    pro.but 207 pro7
    pro.but 208 pro8
    pro.but 209 pro9
    pro.but 210 pro10
    pro.but 211 pro16
    pro.but 212 pro12
    pro.but 213 pro13
    pro.but 214 pro14
    pro.but 215 pro15
    pro.but 216 pro16
    pro.but 217 pro17
    pro.but 218 pro18
    pro.but 219 pro19
    pro.but 220 pro20
    if $did = 127 { $iif($did(127).state = 1,wwin,window -c @whois) }
    if $did = 302 { set %pro.chan $addtok(%pro.chan,$!,44) | did -a protek 301 #$$?="channel ?" }
    if $did = 303 { set %pro.chan $remtok(%pro.chan,$$did(protek,301).sel,44) | did -d protek 301 $$did(protek,301).sel }
    if $did = 401 { hadd protek bstyle $gettok($did(protek,401).seltext,1,58) }
    if ($did = 119) && ($status = connected) { if $did(protek,119).state = 1 .timeridlekick 0 $calc($hget(protek,pro19.edt1) * 60) aydel | else timeridlekick off }
    if $did = 901 { sf4 }
    if $did = 1 { f2 }
    if $did = 2 { f4 }
    if $did = 3 { pscan | .timerf3 -m 1 50 f3 }
    if $did = 43 { prodef }
    if $did = 36 { set.pro.chan | bak.protek }
    else window -c @msg
  }
  if $devent = edit {
    pro.edt 501 edt1
    pro.edt 502 edt2
    pro.edt 503 edt3
    pro.edt 504 edt4
    pro.edt 505 edt5
    pro.edt 506 edt6
    pro.edt 507 edt7
    pro.edt 508 edt8
    pro.edt 509 edt9
    pro.edt 510 edt10
    pro.edt 511 edt11
    pro.edt 512 edt12
    pro.edt 513 edt13
    pro.edt 514 edt14
    pro.edt 515 edt15
    pro.edt 516 edt16
    pro.edt 517 edt17
    pro.edt 518 edt18
    pro.edt 519 edt19
    pro.edt 520 edt20
    pro.edt 521 edt21
    pro.edt 522 edt22
    pro.edt 523 edt23
    pro.edt 524 edt24
    pro.edt 525 edt25
    pro.edt 526 edt26
    pro.edt 527 edt27
    pro.edt 528 edt28
    pro.edt 529 edt29
    pro.edt 530 edt30
    pro.edt 531 edt31
    pro.edt 532 edt32
    if $did isnum 501-526 prev.msg protek $hget(protek,edt $+ $calc($did -500))
    if $did isnum 528-529 prev.msg protek $hget(protek,edt $+ $calc($did -500))
    if $did = 531 prev.msg protek $hget(protek,edt $+ $calc($did -500))
  }
  if $devent = close { window -c @msg | bak.protek }
}
;-=-=-=-=-=-
; DeadLy Script - self PROTECT
;-=-=-=-=-=-
alias cf2 dialog -m selfpro selfpro
dialog selfpro {
  title Self-Protections - $sc
  size -1 -1 450 310
  icon $icons(pro)
  tab Personal, 1001, 10 5 430 260
  box "", 1, 25 29 200 115, tab 1001
  box "", 2, 225 29 200 115, tab 1001
  box "", 3, 25 136 200 115, tab 1001
  box "", 4, 225 136 200 115, tab 1001
  text max, 5, 50 80 50 14, tab 1001
  text in, 6, 110 80 50 14, tab 1001
  text secs, 7, 170 80 50 14, tab 1001
  text max, 8, 250 80 50 14, tab 1001
  text in, 9, 310 80 50 14, tab 1001
  text secs, 10, 370 80 50 14, tab 1001
  text max, 11, 50 190 50 14, tab 1001
  text in, 12, 110 190 50 14, tab 1001
  text secs, 13, 170 190 50 14, tab 1001
  text max, 14, 250 190 50 14, tab 1001
  text in, 15, 310 190 50 14, tab 1001
  text secs, 16, 370 190 50 14, tab 1001
  text Ignore for (secs) :, 17, 60 110 80 14, tab 1001
  text Ignore for (secs) :, 18, 260 110 80 14, tab 1001
  text Ignore for (secs) :, 19, 60 220 80 14, tab 1001
  text Ignore for (secs) :, 20, 260 220 80 14, tab 1001
  check Open Query Flood, 101, 40 45 150 14, tab 1001
  check Private Notice/Text/Action Flood, 102, 240 45 200 14, tab 1001
  check CTCP/DCC Flood, 103, 40 155 150 14, tab 1001
  check Channel Text/Action/Invite Flood, 104, 240 155 200 14, tab 1001
  edit "", 501, 75 78 27 18, tab 1001
  edit "", 502, 135 78 27 18, tab 1001
  edit "", 503, 140 108 40 18, tab 1001
  edit "", 504, 275 78 27 18, tab 1001
  edit "", 505, 335 78 27 18, tab 1001
  edit "", 506, 340 108 40 18, tab 1001
  edit "", 507, 75 188 27 18, tab 1001
  edit "", 508, 135 188 27 18, tab 1001
  edit "", 509, 140 218 40 18, tab 1001
  edit "", 510, 275 188 27 18, tab 1001
  edit "", 511, 335 188 27 18, tab 1001
  edit "", 512, 340 218 40 18, tab 1001

  tab Anti Virus/Nuker, 1002
  box "", 21, 25 29 400 222, tab 1002
  check Back Orifice UDP Detector, 105, 40 50 150 14, tab 1002
  check NetBus Detector, 106, 40 70 150 14, tab 1002
  check NetBios Detector, 107, 40 90 150 14, tab 1002
  check Anti  script.ini, 108, 40 130 150 14, tab 1002
  check Anti  sockets , 109, 40 150 150 14, tab 1002
  check Anti  D.O.S. attack, 110, 40 170 150 14, tab 1002
  check Anti  nuker attack, 111, 40 190 150 14, tab 1002
  check Connections Detector, 112, 290 40 125 28, tab 1002
  list 301, 300 70 80 120, sort vsbar tab 1002
  button &add, 302, 300 190 40 18, tab 1002
  button &del, 303, 340 190 40 18, tab 1002
  button Scan for viruses, 304, 40 220 100 18, tab 1002
  button Connection Status, 305, 290 220 100 18, tab 1002

  tab Slap, 1003
  text actions containing, 24, 43 65 100 14, tab 1003
  text slap revenge msg, 26, 155 65 100 14, tab 1003
  text kick msg, 27, 155 105 100 14, tab 1003
  box "", 28, 25 29 400 222, tab 1003 
  check ON/OFF, 113, 40 40 110 20, tab 1003
  check exclude +o +v on kick/ban, 114, 270 220 150 20, tab 1003
  check slap revenge, 115, 160 160 90 20, tab 1003
  check kick, 116, 270 160 60 20, tab 1003
  check ban, 117, 340 160 60 20, tab 1003
  edit "", 513, 153 80 250 20, autohs tab 1003
  edit "", 514, 153 120 250 20, autohs tab 1003
  list 306, 40 80 110 170, sort tab 1003
  button &add, 308, 153 200 50 18, tab 1003
  button &del, 309, 153 220 50 18, tab 1003

  list 22, 10 270 43 32, size
  list 32, 55 270 43 32, size
  list 33, 110 270 43 32, size
  button "Ok", 307, 320 275 120 25, ok default
}
on 1:dialog:selfpro:*:*: {
  if $devent = init { init5 }
  if $devent = sclick {
    self.chk 101 chk1
    self.chk 102 chk2
    self.chk 103 chk3
    self.chk 104 chk4
    self.chk 105 chk5
    self.chk 106 chk6
    self.chk 107 chk7
    self.chk 108 chk8
    self.chk 109 chk9
    self.chk 110 chk10
    self.chk 111 chk11
    self.chk 112 chk12
    self.chk 113 chk13
    self.chk 114 chk14
    self.chk 115 chk15
    self.chk 116 chk16
    self.chk 117 chk17
    if $did = 105 { if $did(selfpro,105).state = 1 .timerudp 1 60 udp | else .timerudpx 1 60 sockclose udp }
    if $did = 106 { if $did(selfpro,105).state = 1 .timernbus 1 60 nbus | else .timernbusx 1 60 sockclose nbus }
    if $did = 107 { if $did(selfpro,107).state = 1 .timernbios 1 60 nbios | else .timernbiosx 1 60 sockclose nbios }
    if $did = 111 { if $did(selfpro,111).state = 1 .timernbios 1 60 antinuker | else .timernbiosx 1 60 sockclose nuke }
    if $did = 112 { if $did(selfpro,112).state = 1 .timeradoob 1 60 adoob | else .timeradoobx 1 60 sockclose doob* }
    if $did = 302 { var %pr 1
      hadd selfpro self.port $?="port listern ?" $+ , $+ $hget(selfpro,self.port) | if $! = $null halt | did -r selfpro 301 
      while $gettok($hget(selfpro,self.port),%pr,44) != $null { did -a selfpro 301 $gettok($hget(selfpro,self.port),%pr,44) | inc %pr 1 }
    }
    if $did = 303 { var %pr 1
      hadd selfpro self.port $deltok($hget(selfpro,self.port),$findtok($hget(selfpro,self.port),$did(selfpro,301).seltext,1,44),44) | did -r selfpro 301 
      while $gettok($hget(selfpro,self.port),%pr,44) != $null { did -a selfpro 301 $gettok($hget(selfpro,self.port),%pr,44) | inc %pr 1 }
    }
    if $did = 304 { virus }
    if $did = 305 { conn.stat }
    if $did = 306 { did -ra selfpro 513 $hget(slap,$did(selfpro,306).seltext) | did -ra selfpro 514 $hget(slap,kick $+ $did(selfpro,306).seltext) }
    if $did = 308 { var %a $$?="any text/action contains ? " 
      var %b $$?="slap revenge ? $+ $crlf $+ $crlf <action> = action $chr(9) <nick> = nick $+ $crlf <chan> = channel  " 
      var %c $$?="kick revenge ? " 
      hadd -m slap %a %b 
      hadd -m slap kick $+ %a %c
      slap 
    }
    if $did = 309 { var %a $$did(selfpro,306).seltext | hdel slap %a | hdel slap kick $+ %a | slap }
    if $did = 22 { f2 }
    if $did = 32 { f3 }
    if $did = 33 { pscan | .timerf4 -m 1 50 f4 }
    if $did = 307 { bak.setup }
    else window -c @msg
  }
  if $devent = edit {
    self.edt 501 edt1
    self.edt 502 edt2
    self.edt 503 edt3
    self.edt 504 edt4
    self.edt 505 edt5
    self.edt 506 edt6
    self.edt 507 edt7
    self.edt 508 edt8
    self.edt 509 edt9
    self.edt 510 edt10
    self.edt 511 edt11
    self.edt 512 edt12
    if $did = 513 { hadd -m slap $$did(selfpro,306).seltext $$did(selfpro,513) | prev.msg selfpro $did(selfpro,$did) }
    if $did = 514 { hadd -m slap kick $+ $$did(selfpro,306).seltext $$did(selfpro,514) | prev.msg selfpro $did(selfpro,$did) }
  }
  if $devent = close { window -c @msg }
}

on *:OPEN:?:*: {
  if $hget(selfpro,chk1) = on { hinc -mu $+ $hget(selfpro,edt2) events self.query 1
    if $hget(events,self.query) >= $hget(selfpro,edt1) { 
      .ignore -pu $+ $hget(selfpro,edt3) * | close -m $nick | .mode $me +R | .timerR 1 $hget(selfpro,edt3) mode $me -R 
      ęc eat $style1 Open Private/Query Window flood detected, Private/Query messages for $duration($hget(selfpro,edt3)) ... 
      hdel -m events self.query 
      s.flood
    }
  }
}
on *:NOTICE:*:*: {
  if ($hget(selfpro,chk2) = on) && (????serv !iswm $nick) && (. !isin $nick) { hinc -mu $+ $hget(selfpro,edt5) events self.text. $+ $site 1
    if $hget(events,self.text. $+ $site) >= $hget(selfpro,edt4) { 
      hdel events self.text. $+ $site
      .ignore -nu $+ $hget(selfpro,edt6) $site
      ęc eat $style1 Notice flood from $fulladdress - Ignoring notices for $duration($hget(selfpro,edt6)) ... | s.flood
    }
    if $hget(protek,chk6) = off { if $len($strip($1-)) < 50 { return }
      var %code.count = $calc($count($1-,$chr(3)) + $count($1-,$chr(31)) + $count($1-,$chr(15)) + $count($1-,$chr(2)) + $count($1-,$chr(22)))
      var %code.percent = $round($calc(%code.count / $len($strip($1-)) * 100),0)
      var %code.allow = $hget(protek,pro6.edt1)
      if %code.percent >= 75 { 
        .ignore -nu $+ $hget(selfpro,edt6) $site
        mode $me +R | .timerrm 1 $hget(selfpro,edt6) .mode $me -R
        .raw mode $chan +mc | .timermc 1 $hget(selfpro,edt6) .raw mode $chan -mc
        if $me isop # { ban -u1800 $chan $nick 2
          var %r1 $ial($gettok($banmask,1,64),0) | while %r1 > 0 {
            kick # $gettok($ial($gettok($banmask,1,64),%r1),1,33) $hget(protek,edt26) 7»» BotNet Flood Detected. | s.flood
            dec %r1 1
          }
        }
        ęc eat $style1 Notice flood from $fulladdress - Ignoring notices for $duration($hget(selfpro,edt6)) ... | s.flood
        return
      }
    }
  }
}
on *:TEXT:*:?: {
  if ($hget(selfpro,chk2) = on) && $len($strip($1-)) > 15) { hinc -mu $+ $hget(selfpro,edt5) events self.text. $+ $site 1
    if $hget(events,self.text. $+ $site) >= $hget(selfpro,edt4) { 
      hdel events self.text. $+ $site
      .ignore -pu $+ $hget(selfpro,edt6) $site
      ęc eat $style1 Private text flood from $fulladdress - Ignoring private text for $duration($hget(selfpro,edt6)) ...
    }
  }
}
on *:TEXT:*:#: { 
  if ($len($strip($1-)) > 15) && ($hget(selfpro,chk4) = on) { hinc -mu $+ $hget(selfpro,edt11) events self.text. $+ $site $+ $chan 1
    if $hget(events,self.text. $+ $site $+ $chan) >= $hget(selfpro,edt4) { 
      hdel events self.text. $+ $site $+ #
      .ignore -cu $+ $hget(selfpro,edt6) $site
      if ($me isop #) && ($nick isreg #) { 
        hinc -mu3600 events penalty. $+ $+($chan,_,$nick,_flood) 1
        pro.penalty edt7 flood $chan $nick | hdel events fld. $+ $chan $+ . $+ $nick
      }
      ęc eat $style1 Text flood from $fulladdress on # - Ignoring channel's text for $duration($hget(selfpro,edt6)) ... | s.flood
    }
  } 
}
on *:ACTION:*:?: {
  if ($hget(selfpro,chk2) = on) && $len($strip($1-)) > 15) { hinc -mu $+ $hget(selfpro,edt5) events self.text. $+ $site 1
    if $hget(events,self.text. $+ $site) >= $hget(selfpro,edt4) { 
      hdel events self.text. $+ $site 
      .ignore -pu $+ $hget(selfpro,edt6) $site
      ęc eat $style1 Private action flood from $fulladdress - Ignoring private action for $duration($hget(selfpro,edt6)) ...
    }
  }
  if ($hget(selfpro,chk13) = on) && ($me isin $1-) { var %a 1
    while $gettok($1-,%a,32) != $null {
      if $hget(slap,$gettok($1-,%a,32)) != $null { 
        if $hget(selfpro,chk15) = on { describe $nick $replace($hget(slap,$gettok($1-,%a,32)),<nick>,$nick) }
        halt
      }
      inc %a 1
    }
  }
}
on *:ACTION:*:#: {
  if ($len($strip($1-)) > 15) && ($hget(selfpro,chk4) = on) { hinc -mu $+ $hget(selfpro,edt11) events self.text. $+ $site $+ $chan 1
    if $hget(events,self.text. $+ $site $+ $chan) >= $hget(selfpro,edt4) { 
      hdel events self.text. $+ $site $+ #
      .ignore -cu $+ $hget(selfpro,edt6) $site
      if ($me isop #) && ($nick sireg #) { 
        hinc -mu3600 events penalty. $+ $+($chan,_,$nick,_flood) 1
        pro.penalty edt7 flood $chan $nick | hdel events fld. $+ $chan $+ . $+ $nick
      }
      ęc eat $style1 Action flood from $fulladdress on # - Ignoring channel's text for $duration($hget(selfpro,edt6)) ... | s.flood
    }
  } 
  if ($hget(selfpro,chk13) = on) && ($me isin $1-) { var %a 1 
    while $gettok($1-,%a,32) != $null { 
      if $hget(slap,$gettok($1-,%a,32)) != $null { 
        if $hget(selfpro,chk15) = on { describe # $replace($hget(slap,$gettok($1-,%a,32)),<action>,$gettok($1-,%a,32),<nick>,$nick,<chan>,$chan) }
        if ($nick !isreg #) && ($hget(selfpro,chk14) = on) halt
        if ($hget(selfpro,chk16) = on) && ($me isop #) { .timerslap1 1 1 kick # $nick $hget(slap,kick $+ $gettok($1-,%a,32)) }
        if ($hget(selfpro,chk17) = on) && ($me isop #) { .timerslap2 1 1 ban # $nick 3 }
        halt 
      }
      inc %a 1
    }
  }
}
CTCP *:*:*: {
  if $hget(selfpro,chk3) = on && $nick != $me { hinc -mu $+ $hget(selfpro,edt8) events self.ctcp. $+ $site 1
    if $hget(events,self.ctcp. $+ $site) >= $hget(selfpro,edt7) { 
      hdel events self.ctcp. $+ $site 
      .ignore -dtu $+ $hget(selfpro,edt9) $site
      ęc eat $style1 CTCP/DCC flood from $fulladdress - CTCP/DCC private action for $duration($hget(selfpro,edt9)) ... | s.flood
    }
  }
  if $hget(selfpro,chk10) = on { 
    if ($1 = SOUND) || ($1 = MP3) || ($1 = URL) con.dos $remove($1-,.com)
  }
}
on *:INVITE:#: {
  if $hget(selfpro,chk4) = on { hinc -mu $+ $hget(selfpro,edt11) events self.invite. $+ $site 1
    if $hget(events,self.invite. $+ $site) >= $hget(selfpro,edt10) { 
      hdel events self.invite. $+ $site 
      .ignore -pu $+ $hget(selfpro,edt12) $site
      ęc eat $style1 Private action flood from $wildsite - Ignoring private action for $duration($hget(selfpro,edt12)) ... | s.flood
    }
  }
}

on 1:socklisten:ck.detek*: {
  sockaccept self.sock1
  idpt $sock($sockname,1).port
  ęc sat $timestamp $style1 1,8Connections 8,1Detector from $iif($sock($sockname,1).ip != $null,$sock($sockname,1).ip,IP's cannot resolved) on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ).
  ęc sat $timestamp $style1 Connection on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) timed out waiting for data.
  ęc sat $timestamp $style1 Port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) is now disabled for 60 seconds. | ęc sat -
  if $sock($sockname,1).ip != $null { sockopen $sockname $+ bak $sock($sockname,1).ip $sock($sockname,1).port | dns $sock($sockname,1).ip }
  sockclose self.sock1
  sockclose $sockname | .timercd 1 15 ck.detek | s.nuke
}
on 1:SOCKLISTEN:nuke*: {
  ęc sat $timestamp $style1 1,8NUKER 8,1Detected 9Connection $iif($sock($sockname,1).ip != $null,$sock($sockname,1).ip,IP's cannot resolved) on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ).
  ęc sat $timestamp $style1 Connection on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) timed out waiting for data.
  ęc sat $timestamp $style1 Port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) is now disabled for 60 seconds. | ęc sat -
  if $sock($sockname,1).ip != $null { sockopen $sockname $+ bak $sock($sockname,1).ip $sock($sockname,1).port | dns $sock($sockname,1).ip }
  sockclose $sockname | .ignore -wdr60 $sock($sockname,1).ip | nuke.close | .timeran 1 60 antinuker | s.nuke
}
on 1:udpread:udp: {
  idpt $sock($sockname,1).port
  ęc sat $timestamp $style1 1,8UDP BO8,1Detected $iif($sock($sockname,1).ip != $null,$sock($sockname,1).ip,IP's cannot resolved) on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ).
  ęc sat $timestamp $style1 Connection on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) timed out waiting for data.
  ęc sat $timestamp $style1 Port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) is now disabled for 60 seconds. | ęc sat -
  if $sock($sockname,1).ip != $null { sockopen $sockname $+ bak $sock($sockname,1).ip $sock($sockname,1).port | dns $sock($sockname,1).ip }
  sockread 100 &bo | ęc s  Received data: $bvar(&bo,1-100).text
  sockclose $sockname | .timerudp 1 20 udp | s.nuke
}
on 1:socklisten:nbus: {
  sockaccept self.sock2
  ęc sat $timestamp $style1 1,8NETBUS8,1Detected $iif($sock($sockname,1).ip != $null,$sock($sockname,1).ip,IP's cannot resolved) on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ).
  ęc sat $timestamp $style1 Connection on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) timed out waiting for data.
  ęc sat $timestamp $style1 Port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) is now disabled for 60 seconds. | ęc sat -
  if $sock($sockname,1).ip != $null { sockopen $sockname $+ bak $sock($sockname,1).ip $sock($sockname,1).port | dns $sock($sockname,1).ip }
  sockclose self.sock2
  sockclose $sockname | .timernbus 1 15 nbus | s.nuke
}
on 1:udpread:nbios: {
  if $sock($sockname).saddr = $ip { return }
  ęc sat $timestamp $style1 1,8NetBIOS8,1Detected $iif($sock($sockname,1).ip != $null,$sock($sockname,1).ip,IP's cannot resolved) on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ).
  ęc sat $timestamp $style1 Connection on port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) timed out waiting for data.
  ęc sat $timestamp $style1 Port $sock($sockname,1).port ( $+ $sock($sockname,1).type $+ ) is now disabled for 60 seconds. | ęc sat -
  if $sock($sockname,1).ip != $null { sockopen $sockname $+ bak $sock($sockname,1).ip $sock($sockname,1).port | dns $sock($sockname,1).ip }
  sockread 100 &bo | ęc s  Received data: $bvar(&bo,1-100).text
  sockclose $sockname | .timernbios 1 20 nbios | s.nuke
}

on 1:FILERCVD:*: {
  if (.exe = $right($nopath($filename),4)) {
    if $hget(selfpro,chk6) {
      if $lof($filename) = 494592 || $lof($filename) = 472576 { echo -a $style1 9,4 Warning!!!5 $nick 12has sent the trojan NetBus in file5 $nopath($filename) 12the trojan was deleted! | .remove $filename | halt }
    }
    if $hget(selfpro,chk5) {
      if $lof($filename) = 124928 { echo -a $style1 9,4 Warning!!!5 $nick 12has sent the trojan Backorifice(BO) in file5 $nopath($filename) 1the trojan was deleted! | .remove $filename | halt }
    }
  }
  if $hget(selfpro,chk8)  && $nopath($filename) = script.ini { .remove $filename | echo -a $style1 9,4 Removed virus script.ini sent by 4 $nick } 
}

menu @virus {
  copy port $read(s\text\trojans.txt,s,$sline(@virus,1)): clipboard $read(s\text\trojans.txt,s,$sline(@virus,1))
  -
  close: window -c @virus
}

;-=-=-=-=-=-
;-=-=-=-=-=-
