Приложение 1 — детектор событий

Пишется в Tools -> Remote -> Events:

;*** Channel Text Scanning ***
1:ON TEXT:*:#: {
if (%repeat.detector == On) {
if ((%no.op.kick == On) && ($nick isop $chan)) { goto shutupkick }
if (%last.msg. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] == $parms) {
if (%repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] == $null) { set %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] 0 }
inc %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] 1
if (%repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] >= %repeat.flood.trigger) {
if (%on.repeat == Ban) { ban $chan $nick 3 } 
inc %kick.counter 1
kick $chan $nick [X-Protection] Repeated %repeat.flood.trigger times in 10 secs << $+ %kick.counter $+ >>
unset %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ]
goto shutupkick
}
}
set %last.msg. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] $parms
}
:shutupkick
if ($nick == %shut.up.kick) {
inc %kick.counter 1
kick $chan $nick [X-Protection] Shut up kick has been enforced. << $+ %kick.counter $+ >>
}
if (%text.flood.protect == On) {
if ((%no.op.kick == On) && ($nick isop $chan)) { halt }
if (%text.flood.rate. [ $+ [ $nick ] ] >= %text.flood.trigger) { ban $chan $nick 3 | inc %kick.counter 1 | kick $chan $nick [X-Protection] Max %text.flood.trigger Lines in 10 secs Reached << $+ %kick.counter $+ >> | unset %flood.rate. [ $+ [ $nick ] ] }
inc %text.flood.rate. [ $+ [ $nick ] ] 1
}
if (%max.text.protect == On) {
if ($len($parms) >= %max.text.length) {
if ((%no.op.kick == On) && ($nick isop $chan)) { halt }
inc %kick.counter 1
ban $chan $nick 3
kick $chan $nick [X-Protection] Max Text Length %max.text.length Your’s was $len($parms) characters long << $+ %kick.counter $+ >>
}
}
}
1:ON ACTION:*:#: {
if (%repeat.detector == On) {
if ((%no.op.kick == On) && ($nick isop $chan)) { goto shutupkick }
if (%last.msg. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] == $parms) {
if (%repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] == $null) { set %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] 0 }
inc %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] 1
if (%repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] >= %repeat.flood.trigger) {
if (%on.repeat == Ban) { ban $chan $nick 3 } 
inc %kick.counter 1
kick $chan $nick [X-Protection] Repeated %repeat.flood.trigger times in 10 secs << $+ %kick.counter $+ >>
unset %repeat.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ]
goto shutupkick
}
}
set %last.msg. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] $parms
}
:shutupkick
if ($nick == %shut.up.kick) {
inc %kick.counter 1
kick $chan $nick [X-Protection] Shut up kick has been enforced. << $+ %kick.counter $+ >>
}
if (%text.flood.protect == On) {
if ((%no.op.kick == On) && ($nick isop $chan)) { halt }
if (%text.flood.rate. [ $+ [ $nick ] ] >= %text.flood.trigger) { ban $chan $nick 3 | inc %kick.counter 1 | kick $chan $nick [X-Protection] Max %text.flood.trigger Lines in 10 secs Reached << $+ %kick.counter $+ >> | unset %flood.rate. [ $+ [ $nick ] ] }
inc %text.flood.rate. [ $+ [ $nick ] ] 1
}
if (%max.text.protect == On) {
if ($len($parms) >= %max.text.length) {
if ((%no.op.kick == On) && ($nick isop $chan)) { halt }
inc %kick.counter 1
ban $chan $nick 3
kick $chan $nick [X-Protection] Max Text Length %max.text.length Your’s was $len($parms) characters long << $+ %kick.counter $+ >>
}
}
}
;*** Nick Scanning Routines ***
1:ON NICK: {
if ($nick == %shut.up.kick) { shutupkick $newnick }
if (%nick.flood.protect == On) {
if (%nick.flood.rate. [ $+ [ $nick ] ] == $null) { set %nick.flood.rate. [ $+ [ $nick ] ] 0 }
set %nick.flood.rate. [ $+ [ $newnick ] ] %nick.flood.rate. [ $+ [ $nick ] ]
inc %nick.flood.rate. [ $+ [ $newnick ] ] 1
unset %nick.flood.rate. [ $+ [ $nick ] ]
if (%nick.flood.rate. [ $+ [ $newnick ] ] >= %nick.flood.trigger) { nickflood $newnick }
}
if (%vulgar.nick.kick == On) {
if (shit isin $newnick) { vulgarnick $newnick }
if (cunt isin $newnick) { vulgarnick $newnick }
if (fuck isin $newnick) { vulgarnick $newnick }
if (bitch isin $newnick) { vulgarnick $newnick }
if (dickhead isin $newnick) { vulgarnick $newnick }
if (pussy isin $newnick) { vulgarnick $newnick }
}
}
;*** Join Scanning Routines ***
1:ON JOIN:#: {
if (%anti.sex.channel == On) {
whois $nick
}
if (%join.flood.protect == On) {
if (%join.flood.rate. [ $+ [ $nick [ $+ [$chan ] ] ] ] == $null) { set %join.flood.rate. [ $+ [ $nick [ $+ [$chan ] ] ] ] 0 }
inc %join.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] 1
if (%join.flood.rate. [ $+ [ $nick. [ $+ [ $chan ] ] ] ] >= %join.flood.trigger) {
inc %kick.counter 1
ban $chan $nick 3
kick $chan $nick [X-Protection] Revolving Door. Max %join.flood.trigger joins in 10 secs << $+ %kick.counter $+ >>
}
}
if (%vulgar.nick.kick == On) {
if (shit isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
if (cunt isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
if (bitch isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
if (fuck isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
if (dickhead isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
if (pussy isin $nick) { mode $chan +b $nick | inc %kick.counter 1 | kick $chan $nick [X-Protection] Vulgar Nick — Change it << $+ %kick.counter $+ >> }
}
}
1:ON KICK:#: {
if ($knick == $me) { kick $chan $nick Bitch }
if (%revenge == On) {
if ($knick == $me) { auser =999 $nick | guser =999 $nick 3 }
}
}

В принципе все должно быть понятно %), но если не все понятно, вот несколько подсказок:
— значок % означает переменную в памяти
— $chan, $nick, $parms и т.п. — служебные переменные
— ==, &&, >= и т.п. — логические операторы
— inc — оператор-инкремент, короче единичку прибавляет
— halt — стоп-кран 🙂
— $+ — разделитель, позволяющий собирать конструкцию

Приложение 2 — подлизанный Popups для окна статуса

Пишется в Tools -> Popups -> Status:

X-protection:/ame is using the X-Protection — http://www.xakep.ru

Channel Options
.[X-Protection] Channel Options: { 
echo 2 [X-Protection] Repeat Kick is %repeat.detector set to: %on.repeat on %repeat.flood.trigger repeats 
echo 2 [X-Protection] Channel Text Flood Protect is %text.flood.protect set to: max %text.flood.trigger lines in 10 secs. 
echo 2 [X-Protection] Nick Flood Protection is %nick.flood.protect set to: max %nick.flood.trigger nick changes in 15 secs 
echo 2 [X-Protection] Max Text Length is %max.text.protect set to: %max.text.length characters max 
echo 2 [X-Protection] Join Flood Protection is %join.flood.protect set to: max %join.flood.trigger joins in 10 secs
echo 2 [X-Protection] Vulgar Nick Kick is %vulgar.nick.kick
}
.-
.Repeat Protection
..Kick
…On:/set %repeat.flood.trigger $$?=»Max Repeats in 10 secs:» | /.timer102 0 10 /unset %repeat.flood.rate* | /set %repeat.detector On | /set %on.repeat Kick | /echo 2 [X-Protection] Repeat Detector On set to %on.repeat on %repeat.flood.trigger repeats.
…Off:/set %repeat.detector Off | /echo 2 [X-Protection] Repeat Detector Off
..Kick/Ban
…On:/set %repeat.flood.trigger $$?=»Max Repeats in 10 secs:» | /.timer102 0 10 /unset %repeat.flood.rate* | /set %repeat.detector On | /set %on.repeat Ban | /echo 2 [X-Protection] Repeat Detector On set to Ban on %repeat.flood.trigger repeats.
…Off:/set %repeat.detector Off | /echo 2 [X-Protection] Repeat Detector Off
.Text Flood Protection
..On:/set %text.flood.trigger $$?=»Max Lines Allowed in 10 secs:» | /.timer100 0 10 /unset %text.flood.rate* | /set %text.flood.protect On | /echo 2 [X-Protection] Text Flood Protect On set to max %text.flood.trigger lines in 10 secs.
..Off:/.timer100 off | /set %text.flood.protect Off | /echo 2 [X-Protection] Text Flood Protect Off
.Nick Flood Protection
..On:/set %nick.flood.trigger $$?=»Max Nicks Allowed in 15 secs:» | /.timer101 0 15 /unset %nick.flood.rate* | /set %nick.flood.protect On | /echo 2 [X-Protection] Nick Flood Protect On set to max %nick.flood.trigger nicks in 15 secs.
..Off:/.timer101 off | /set %nick.flood.protect Off | /echo 2 [X-Protection] Nick Flood Protection Off
.Text Length Protection
..On:/set %max.text.length $$?=»Max Length of Channel Text:» | /set %max.text.protect On | /echo 2 [X-Protection] Text Length Protect On set to max %max.text.length characters.
..Off:/set %max.text.protect Off | /echo 2 [X-Protection] Text Length Protect Off
.Join Flood Protection
..On:/set %join.flood.trigger $$?=»Max Joins in 10 secs:» | /set %join.flood.protect On | /timer103 0 10 /unset %join.flood.rate* | /echo 2 [X-Protection] Join Flood Protection On set to max %join.flood.trigger joins in 10 secs.
..Off:/set %join.flood.protect off | /timer103 off | /echo 2 [X-Protection] Join Flood Protection Off
.Vulgar Nick Protection
..On:/set %vulgar.nick.kick On | /echo 2 [X-Protection] Vulgar Nick Kick On
..Off:/set %vulgar.nick.kick Off | /echo 2 [X-Protection] Vulgar Nick Kick Off
User Options
.[X-Protection] User Options: {
echo 2 [X-Protection] No Op Kick is %no.op.kick 
echo 2 [X-Protection] Blacklist is %black.list
echo 2 [X-Protection] Auto-Op Protection is %auto.op.protect
echo 2 [X-Protection] Revenge is %revenge
}
.-
.No Op Kick
..On:/set %no.op.kick On | /echo 2 [X-Protection] No Op Kick is On
..Off:/set %no.op.kick Off | /echo 2 [X-Protection] No Op Kick is Off
.BlackList
..On:/set %black.list On | /echo 2 [X-Protection] Blacklist is On
..Off:/set %black.list Off | /echo 2 [X-Protection] Blacklist is Off
.Auto-Op/Protect
..On:/set %auto.op.protect On | /echo 2 [X-Protection] Now Protecting and auto-oping your friends.
..Off:/set %auto.op.protect Off | /echo 2 [X-Protection] Auto-Op/Protection is now Off
.Revenge
..On:/set %revenge On | /echo 2 [X-Protection] Revenge Mode is On — Auto-Blacklisting Users
..Off:/set %revenge Off | /echo 2 [X-Protection] Revenge is Off
User Levels
.Auto-Op/Protect
..Add User:/set %auser $$?=»Enter Nick to Blacklist:» | /auser 100 %auser | /guser 100 %auser 3
..Remove User:/set %ruser $$?=»Enter Nick to Remove:» | /ruser %ruser | /ruser %ruser 3
..List:/ulist 100
..Reset:/rlevel 100
.BlackList
..Add User:/set %auser $$?=»Enter Nick to Blacklist:» | /auser =999 %auser | /guser =999 %auser 3
..Remove User:/set %ruser $$?=»Enter Nick to Remove:» | /ruser %ruser | /ruser %ruser 3
..List:/ulist =999
..Reset:/rlevel =999

Away
.Set Away: { 
if ($away == $true) { echo 4 [X-Protection] You are already marked as being away! | halt }
set %away.msg $$?=»Enter Your Away Msg:» | set %away.nick $me | nick $me $+ -Away | away %away.msg | ame is away -=- %away.msg -=- since [ $+ $time] [X-Protection] | .timer800 0 300 /ame is away -=- %away.msg -=- since [ $+ $time] [X-Protection] 

.Set Back: { 
if ($away == $false) { echo 4 [X-Protection] You are not away! | halt }
nick %away.nick | away | ame is back! | unset %away* | .timer800 off 
}
Kick Counter
.Echo Info:/echo 2 [X-Protection] Kick Counter: %kick.counter lamers kicked since %kick.counter.date
.Amsg Info:/amsg [X-Protection] Kick Counter: %kick.counter lamers kicked since %kick.counter.date
.Reset Counter:/set %kick.counter 0 | /set %kick.counter.date $adate | /echo 2 [X-Protection] Kick Counter Reset

Ко всему вышеперечисленному я добавил еще в менюшки вывод текущих установок, установку NoOp Kick, чтобы не задеть шальной пулей своих :), возможность через меню править списки
юзверей или полностью обнулять их. 

Пы.Сы. 

Это естественно всего лишь «маленький» 🙂 пример, как можно использовать скрипты в своих целях, но наглядно показывающий весь процесс, а главное с конечным результатом, который может использовать каждый. Единственное данный скрипт не подойдёт пользователям Pirch, потому что там написание скрипта немного отлично от Mirc.

Оставить мнение

Check Also

Страдания с ReactOS. Почему в заменителе Windows работают трояны, но не работает Word

Сегодня в нашей кунсткамере демонстрируется необычайный организм — двадцатилетний зародыш …