misc.txt
来自「在上载一个bot源码给喜欢研究僵尸网络的朋友」· 文本 代码 · 共 327 行 · 第 1/2 页
TXT
327 行
;@@@
;@@@ DreamBot IRC Bot 5.1
;@@@ File description: misc features and quick-module (qmod)
;@@@ Design & coding: Madar Petru
;@@@ (C) Copyright 2004-2005 by Madar Petru. All rights reserved.
;@@@
alias _main {
.unset %banned [ $+ [ $1 ] ]
if ($me !isop $1) && ($me !ishop $1) { halt }
if ($readini(ini\channels.ini, $1, STopic) == On) {
if (($read(ini\tlines.txt, s, $1) !== $null) && ($chan($1).topic !=== $read(ini\tlines.txt, s, $1))) { topic $1 $read(ini\tlines.txt, s, $1) }
}
if (($readini(ini\globals.ini, HelpMode, AModerated) == On) && ($Readini(ini\channels.ini, $1, HelpMode) == On)) {
if (m !isin $chan($1).mode) { mode $1 +m }
}
if ($readini(ini\channels.ini, $1, SModes) == Off) { halt }
if ($readini(ini\channels.ini, $1, SModes) == $null) { halt }
if (($readini(ini\channels.ini, $1, SModes) !== Off) || ($readini(ini\channels.ini, $1, SModes) !== $null)) { mode $1 $readini(ini\channels.ini, $1, SModes) }
_live.kb $1
}
on 1:exit: {
unset %q*
unset %fb*
unset %lock*
unset %evtrig*
unset %floodnick*
unset %waitlist.*
unset %next.*
}
on 1:disconnect: {
unset %q*
unset %fb*
unset %lock*
unset %evtrig*
unset %floodnick*
unset %ban.*
}
on 100:text:*say*:#: {
if ($1 == %c $+ set_say) {
if ($level($mask($address($nick,2),2)) < 500) { .msg $nick Only the bot owner can enable the Say mode. | halt }
if ($level($mask($address($nick,2),2)) == 500) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ set_say <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\globals.ini Features Say On | .msg $nick The Say mode is now enabled. | halt }
if ($2 == off) { writeini -n ini\globals.ini Features Say Off | .msg $nick The Say mode is now disabled. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
}
if ($1 == %c $+ say) {
if ($readini(ini\globals.ini, Features, Say) == Off) { .msg $nick The Say mode is not enabled. To enable use %c $+ set_say <on|off>. Only the bot owner can enable this setting. | halt }
if ($readini(ini\globals.ini, Features, Say) == On) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ say <text to say>. | halt }
if ($2 !== $null) { .msg $chan $2- }
}
}
}
on 500:text:set_say*:?: {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me set_say <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\globals.ini Features Say On | .msg $nick The Say mode is now enabled. | halt }
if ($2 == off) { writeini -n ini\globals.ini Features Say Off | .msg $nick The Say mode is now disabled. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
on 100:text:say*:?: {
if ($readini(ini\globals.ini, Features, Say) == Off) { .msg $nick The Say mode is not enabled. To enable use /msg $me set_say <on|off>. Only the bot owner can enable this setting. | halt }
if ($readini(ini\globals.ini, Features, Say) == On) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me say <#channel> <text to say>. | halt }
if (($2 !== $null) && ($3 == $null)) { .msg $nick You didn't specified any text to say. }
if (($2 !== $null) && ($3 !== $null) && ($left($2,1) == $chr(35))) { .msg $2 $3- }
}
}
ctcp *:VERSION:?: {
.ctcpreply $nick VERSION $dbver(text) $+ . Get it at: $dbver(site) - The best Windows bot!
}
on @25:text:*status*:#: {
if ($1 == %c $+ status) {
if ($2 == $null) { .msg $nick Please specifiy the display mode. Syntax: %c $+ status <public|private>. | halt }
if ($2 == private) {
.timer 1 1 .msg $nick Status information for $chan $+ :
if ($chan($chan).topic !== $null) { .timer 1 3 .msg $nick Topic is $chan($chan).topic }
.timer 1 5 .msg $nick Current channel modes: $chan($chan).mode $+ .
.timer 1 7 .msg $nick There are currently $nick($chan,0) persons on the channel, $nick($chan,0,o) op(s), $nick($chan,0,v) voice(s) and $nick($chan,0,r) regular(s).
.timer 1 9 .msg $nick Total bans: $ibl($chan,0) $+ .
}
if ($2 == public) {
.timer 1 1 .msg $chan Status information for $chan $+ :
if ($chan($chan).topic !== $null) { .timer 1 3 .msg $chan Topic is $chan($chan).topic }
.timer 1 5 .msg $chan Current channel modes: $chan($chan).mode $+ .
.timer 1 7 .msg $chan There are currently $nick($chan,0) persons on the channel, $nick($chan,0,o) op(s), $nick($chan,0,v) voice(s) and $nick($chan,0,r) regular(s).
.timer 1 9 .msg $chan Total bans: $ibl($chan,0) $+ .
}
}
}
on 400:text:*autovoice*:#: {
if ($1 == %c $+ autovoice) {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ autovoice <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\channels.ini $chan AutoVoice On | .msg $nick AutoVoice for $chan is now ON. Everyone that joins this channel will be voiced. | .msg $nick >>> WARNING: This makes channel lock more inefficient. | halt }
if ($2 == off) { writeini -n ini\channels.ini $chan AutoVoice Off | .msg $nick AutoVoice for $chan is now OFF. Everyone that joins this channel will not be voiced anymore. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
}
on 400:text:autovoice*:?: {
if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me autovoice <#channel> <on|off>. | halt }
if ($2 !== $null) {
if ($3 == on) { writeini -n ini\channels.ini $2 AutoVoice On | .msg $nick AutoVoice for $2 is now ON. Everyone that joins this channel will be voiced. | .msg $nick >>> WARNING: This makes channel lock more inefficient. | halt }
if ($3 == off) { writeini -n ini\channels.ini $2 AutoVoice Off | .msg $nick AutoVoice for $2 is now OFF. Everyone that joins this channel will not be voiced anymore. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
on 400:text:*bitchmode*:#: {
if ($1 == %c $+ bitchmode) {
if ($2 == $null) { .msg $nick Command incomlpete. Syntax: %c $+ bitchmode <on|off>. | halt }
if ($2 !== $null) {
if ($2 == on) { writeini -n ini\channels.ini $chan Bitchmode On | .msg $nick The bitch mode for $chan is now enabled. Everyone that is oped by other person than the bot will be deoped. | halt }
if ($2 == off) { writeini -n ini\channels.ini $chan Bitchmode Off | .msg $nick The bitch mode for $chan is now disabled. Everyone that is oped by other person than the bot will NOT be deoped anymore. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
}
on 400:text:bitchmode*:?: {
if ($2 == $null) { .msg $nick Command incomlpete. Syntax: /msg $me bitchmode <#channel> <on|off>. | halt }
if ($2 !== $null) {
if ($3 == on) { writeini -n ini\channels.ini $2 Bitchmode On | .msg $nick The bitch mode for $2 is now enabled. Everyone that is oped by other person than the bot will be deoped. | halt }
if ($3 == off) { writeini -n ini\channels.ini $2 Bitchmode Off | .msg $nick The bitch mode for $2 is now disabled. Everyone that is oped by other person than the bot will NOT be deoped anymore. | halt }
else { .msg $nick >>> Error: Invalid parameters. Available parameters: ON/OFF. | halt }
}
}
on @1:op:#: {
if ($readini(ini\channels.ini, $chan, Bitchmode) == On) {
if ($nick == $me) { halt }
if ($opnick == $me) { halt }
if (($level($mask($address($nick,2),2)) >= 400) || ($level($mask($address($opnick,2),2)) >= 400)) { halt }
else { mode $chan -o $opnick | .msg $nick The bitchmode for $chan is enabled. }
}
}
on *:join:#: {
if ($nick == $me) {
.timer 1 3 _main $chan
.timerQub $+ $chan 0 5 qub $chan
.timerQb $+ $chan 0 5 qb $chan
.timerQKlist $+ $chan 0 5 qk $chan
.timerQdVoice $+ $chan 0 5 qdvoice $chan
.timerQVoice $+ $chan 0 7 qvoice $chan
.timerQm $+ $chan 0 30 _main $chan
_float $chan
}
if ($me !isop $chan) && ($me !ishop $chan) { halt }
if (($readini(ini\channels.ini, $chan, Greet) == On) && ($read(ini\grlines.txt, s, $chan) !== $null)) { .notice $nick $read(ini\grlines.txt, s, $chan) }
if ($readini(ini\channels.ini, $chan, AutoVoice) == on) {
qvadd $chan $nick
halt
}
if ($readini(ini\channels.ini, $chan, AutoVoice) == off) { halt }
}
alias qvadd {
;Syntax: /qvadd <#channel> <nick>
if ($istok(%qvoice [ $+ [ $1 ] ],$2,32) == $true) { halt }
if (%qvoice [ $+ [ $1 ] ] == $null) { set %qvoice [ $+ [ $1 ] ] $2 | halt }
if ((%qvoice [ $+ [ $1 ] ] !== $null) && ($numtok(%qvoice [ $+ [ $1 ] ],32) >= 6)) { qvoice $1 | set %qvoice [ $+ [ $1 ] ] $2 | halt }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?