📄 ctcp.txt
字号:
;@@@
;@@@ DreamBot IRC Bot 5.1
;@@@ File description: channel ctcp protection
;@@@ Design & coding: Madar Petru
;@@@ (C) Copyright 2004-2005 by Madar Petru. All rights reserved.
;@@@
on 400:text:*ctcp*:#: {
if ($1 == %c $+ global_ctcp) {
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_ctcp <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\globals.ini Protections CTCP On | .msg $nick Global CTCP Protection now set to ON. | .enable #CTCP | halt }
if ($2 == off) { writeini -n ini\globals.ini Protections CTCP Off | .msg $nick Global CTCP Protection now set to OFF. | .disable #CTCP | halt }
else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
}
}
if ($1 == %c $+ channel_CTCP) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ channel_ctcp <on|off>. | halt }
if ($2 !== $null) {
if (($readini(ini\globals.ini, Protections, CTCP) == off) || ($readini(ini\globals.ini, Protections, CTCP) == $null)) { .msg $nick Global CTCP Protection not enabled. Contact the bot owner to enable it. | halt }
if ($2 == on) { writeini -n ini\channels.ini $chan CTCP On | .msg $nick CTCP protection for $chan set to ON. | halt }
if ($2 == off) { writeini -n ini\channels.ini $chan CTCP Off | .msg $nick CTCP protection for $chan set to OFF. | halt }
else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
}
}
}
on 400:text:*CTCP*:?: {
if ($1 == global_ctcp) {
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_ctcp <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\globals.ini Protections CTCP On | .msg $nick Global CTCP Protection now set to ON. | .enable #CTCP | halt }
if ($2 == off) { writeini -n ini\globals.ini Protections CTCP Off | .msg $nick Global CTCP Protection now set to OFF. | .disable #CTCP | halt }
else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
}
}
if ($1 == channel_ctcp) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me channel_ctcp <#channel> <on|off>. | halt }
if ($2 !== $null) && ($3 !== $null) {
if (($readini(ini\globals.ini, Protections, CTCP) == off) || ($readini(ini\globals.ini, Protections, CTCP) == $null)) { .msg $nick Global CTCP Protection not enabled. Contact the bot owner to enable it. | halt }
if ($3 == on) { writeini -n ini\channels.ini $2 CTCP On | .msg $nick CTCP protection for $2 set to ON. | halt }
if ($3 == off) { writeini -n ini\channels.ini $2 CTCP Off | .msg $nick CTCP protection for $2 set to OFF. | halt }
else { .msg $nick Incorrect parameter. Available parameters: ON/OFF. | halt }
}
}
}
#ctcp on
ctcp @+1!:*:#: {
if $nick isop $chan { halt }
if $_protect(ctcp,$chan) == $false { halt }
; begin punishments
; 1 = warn, kick ban
; 2 = warn, kick
; 3 = kick ban
if %kb.method == 1 {
; check user
if %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] == $null { set %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] 1 | _warn $chan $nick ctcp | halt }
if %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] == 1 { qbadd $chan $address($nick,2) $nick }
}
if %kb.method == 2 {
; check user
if %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] == $null { set %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] 1 | _warn $chan $nick ctcp | halt }
if %p.ctcpW [ $+ [ $chan ] ] [ $+ [ $nick ] ] == 1 { qkadd $chan $nick }
}
if %kb.method == 3 {
; check user
qbadd $chan $address($nick,2) $nick | halt
}
}
#ctcp end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -