⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protection.txt

📁 在上载一个bot源码给喜欢研究僵尸网络的朋友
💻 TXT
字号:
;@@@
;@@@ DreamBot IRC Bot 5.1
;@@@ File description: channel flood protection
;@@@ Design & coding: Madar Petru
;@@@ (C) Copyright 2004-2005 by Madar Petru. All rights reserved. 
;@@@

on 400:text:*flood*:#: {
  if ($1 == %c $+ global_flood) {
    if ($level($mask($address($nick,2),2)) < 500) { .msg $nick Only the bot owner can set this flag. | halt }
    if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ global_flood <on|off>. | halt }
    if ($2 !== $null) { 
      if ($2 == on) { writeini -n ini\globals.ini Protections Flood On | .msg $nick Global Flood Protection now set to ON. | .enable #flood | halt }
      if ($2 == off) { writeini -n ini\globals.ini Protections Flood Off | .msg  $nick Global Flood Protection now set to OFF. | .disable #flood | halt }
      else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
    }
  }
  if ($1 == %c $+ channel_flood) {
    if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ channel_flood <on|off>. | halt }
    if ($2 !== $null) {
      if (($readini(ini\globals.ini, Protections, Flood) == off) || ($readini(ini\globals.ini, Protections, Flood) == $null)) { .msg $nick Global Flood Protection not enabled. Contact the bot owner to enable it. | halt }
      if ($2 == on) { writeini -n ini\channels.ini $chan Flood On | .msg $nick Flood protection for $chan set to ON. | halt }
      if ($2 == off) { writeini -n ini\channels.ini $chan Flood Off | .msg $nick Flood protection for $chan set to OFF. | halt }
      else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
    }
  }
}
on 400:text:*flood*:?: {
  if ($1 == global_flood) {
    if ($level($mask($address($nick,2),2)) < 500) { .msg $nick Only the bot owner can set this flag. | halt }
    if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me global_flood <on|off>. | halt }
    if ($2 !== $null) { 
      if ($2 == on) { writeini -n ini\globals.ini Protections Flood On | .msg $nick Global Flood Protection now set to ON. | .enable #flood | halt }
      if ($2 == off) { writeini -n ini\globals.ini Protections Flood Off | .msg  $nick Global Flood Protection now set to OFF. | .disable #flood | halt }
      else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
    }
  }
  if ($1 == channel_flood) {
    if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me channel_flood <#channel> <on|off>. | halt }
    if ($2 !== $null) && ($3 !== $null) {
      if (($readini(ini\globals.ini, Protections, Flood) == off) || ($readini(ini\globals.ini, Protections, Flood) == $null)) { .msg $nick Global Flood Protection not enabled. Contact the bot owner to enable it. | halt }
      if ($3 == on) { writeini -n ini\channels.ini $2 Flood On | .msg $nick Flood protection for $2 set to ON. | halt }
      if ($3 == off) { writeini -n ini\channels.ini $2 Flood Off | .msg $nick Flood protection for $2 set to OFF. | halt }
      else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
    }
  }
}
#flood on
on @+1!:text:*:#: {
  if ($nick isop $chan) { halt }
  inc %flood.nick [ $+ [ $nick ] $+ [ $chan ] ]
  .timer 1 %flood.channel.time /unset %flood.nick [ $+ [ $nick ] $+ [ $chan ] ]
  if (%flood.nick [ $+ [ $nick ] $+ [ $chan ] ] > %flood.channel.lines) { 
    if (($readini(ini\globals.ini, Protections, Flood) == on) && ($readini(ini\channels.ini, $chan, Flood) == on)) { $iif(%kb.method != 2, mode $chan +btn $mask($address($nick,2),2)) | kick $chan $nick $cl Flood | unset %flood.nick [ $+ [ $nick ] ] | halt }
  }
  else { halt }
}
on @+1!:action:*:#: {
  if ($nick isop $chan) { halt }
  inc %flood.nick [ $+ [ $nick ]  $+ [ $chan ]
  .timer 1 %flood.channel.time /unset %flood.nick [ $+ [ $nick ] $+ [ $chan ]
  if (%flood.nick [ $+ [ $nick ] $+ [ $chan ] > %flood.channel.lines) { 
    if (($readini(ini\globals.ini, Protections, Flood) == on) && ($readini(ini\channels.ini, $chan, Flood) == on)) { $iif(%kb.method != 2, mode $chan +btn $mask($address($nick,2),2)) |  kick $chan $nick $cl Flood | unset %flood.nick [ $+ [ $nick ] ] | halt  }
  }
  else { halt }
}
#flood end
on @1:deop:#: {
  if ($nick == $me) { halt }
  if ($level($mask($address($opnick,2),2)) > $level($mask($address($nick,2),2))) { mode $chan -o+o $nick $opnick | .msg $nick Illegal deop. }
}
;@@@ Self protections @@@
on +1!:Text:*:?: {
  if ($readini(ini\globals.ini, Protections, SFlood) == On) {
    inc %flood.nick [ $+ [ $nick ]
    .timer 1 %flood.self.time /unset %flood.nick [ $+ [ $nick ]
    if (%flood.nick [ $+ [ $nick ]  > %flood.self.num) { 
      .ignore -pnitkdu $+ %flood.self.ignore $nick 2
    }
  }
}
on +1!:notice:*:?: {
  if ($readini(ini\globals.ini, Protections, SNotice) == On) {
    inc %flood.nickN [ $+ [ $nick ]
    .timer 1 %notice.self.time /unset %flood.nickN [ $+ [ $nick ]
    if (%flood.nickN [ $+ [ $nick ]  > %notice.self.num) { 
      .ignore -pnitkdu $+ %notice.self.ignore $nick 2
    }
  }
}
ctcp +1!:*:?: {
  if ($readini(ini\globals.ini, Protections, SCtcp) == On) {
    inc %flood.nickC [ $+ [ $nick ]
    .timer 1 %CTCP.self.time /unset %flood.nickC [ $+ [ $nick ]
    if (%flood.nickC [ $+ [ $nick ]  > %CTCP.self.num) { 
      .ignore -pnitkdu $+ %CTCP.self.ignore $nick 2
    }
  }
}
on +1!:invite:*: {
  if ($readini(ini\globals.ini, Protections, SInvite) == On) {
    inc %flood.nickI [ $+ [ $nick ]
    .timer 1 %invite.self.time /unset %flood.nickI [ $+ [ $nick ]
    if (%flood.nickI [ $+ [ $nick ]  > %invite.self.num) { 
      .ignore -pnitkdu $+ %invite.self.ignore $nick 2
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -