EpicNet.Ru - Форум IRC Чата

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Channel protection with set (+Dm) modes and enter a captcha for access


Channel protection with set (+Dm) modes and enter a captcha for access

Сообщений 1 страница 2 из 2

1

My rooms sets mode (+Dm)

Someone join myroom after 10 seconds will received a messages from MyBot in PM is:

ATTENTION: You just tried to join %dmchan $+ . Since we're being attacked by bots, please type: %hucheck. [ $+ [ %nick ] ] <== (captcha) to prove that you're a human. If you do, you will be permitted to join. If you mess up, nothing will happen.

When someone type exactly captcha in PM of MyBot, then get voiced in myroom and received this message from MyBot in PM:

Welcome to %dmchan $+ , $nick $+ . Sorry for the inconvienence you experienced!

But it NOT work, and have some errors are:

1. Someone receive message in PM but when they type exactly captcha in PM of MyBot and NOTHING happened.
2. I see this line after fews seconds repeats many time and never stop:  Scanning Hidden User: <nothing here>
3. Nickname received every 60 seconds this repeat line in PM:  ATTENTION: You just tried to join %dmchan $+ . Since we're being attacked by bots, please type: %hucheck. [ $+ [ %nick ] ] <== (captcha) to prove that you're a human. If you do, you will be permitted to join. If you mess up, nothing will happen. And they type exactly captcha but nothing happened.


Here is code:

Код:
menu channel, {
  $iif(undernet isin $network,Delay Voice)
  ..ON:/husers | mode $chan +Dm
  ..OFF:/husers | mode $chan -Dm
}

alias husers {
  .names -d $chan
  if ( $timer(hUsers) != $null ) {
    .timerhUsers off | unset %huserchan
    echo -at Delay Hidden voice Script is Off!
    unset %dmchan
  }
  else { .timerhUsers 0 15 .names -d $chan | set %huserchan $chan
    echo -at Delay Hidden voice Script is On! Make 4Sure That everyone is +v
    set %dmchan $chan
  }
}

raw 355:*: {
  if ( $4 == $null ) { HALT }
  else {
    set %allnicks $4-
    set %i 1
    :next
    set %nick $gettok(%allnicks,%i, 32)
    if %nick == $null goto done
    if $istok( %nrdone,%nick,32 ) { inc %i | goto next }
    .set -u60 %nrdone %nrdone %nick
    .enable #ghost
    .whois %nick
    .set -u300 %hucheck. [ $+ [ %nick ] ] $rand(A,Z) $+ $rand(1,10) $+ $rand(A,Z) $+ $rand(1,10) $+ $rand(1,10) $+ $rand(1,10) $+ $rand(A,Z) $+ $rand(A,Z) $+ $rand(1,10)
    .msg %nick ATTENTION: You just tried to join %dmchan $+ . Since we're being attacked by bots, please type: %hucheck. [ $+ [ %nick ] ]  to prove that you're a human. If you do, you will be permitted to join. If you mess up, nothing will happen.
    inc %i
    goto next
    :done
  }
  halt
}

raw 366:*: halt

#ghost off
raw 301:*: halt
raw 310:*: halt
raw 311:*: { echo -at 4 $+ Scanning Hidden User: $address($2,5)  | halt }
raw 312:*: halt
raw 313:*: halt
raw 330:*: halt
raw 319:*: halt
raw 317:*: halt
raw 318:*: { .timer 1 5 .disable #ghost | haltdef }
#ghost end

on *:text:*:?:{
  if ($1 = %hucheck. [ $+ [ $nick ] ]) { mode %dmchan +v $nick | msg $nick Welcome to %dmchan $+ , $nick $+ . Sorry for the inconvienence you experienced! | aline @Information 3 $nick ( $+ $addresss($nick,5) has verified that they are human. | halt }
  if ($1 != %hucheck. [ $+ [ $nick ] ]) { halt }
  if (!$1) { halt }
}

Please fixed or rewrite that code and make it work. Thanks so much

2

Предоставленный вами код содержит множество ошибок с запутанными межстрочными связями, в которых трудно разобраться, чтобы расплести этот клубок.
Но поскольку я примерно понял концепцию идеи данного скрипта, то я принял решение создать свою собственную версию с аналогичным функционалом.

Итак, вы можете попробовать использовать этот код скрипта:

Код:
;######################################################################
;#  Name: Captcha Channel Security v1.0
;#  Author: Epic (http://epicnet.ru, irc.epicnet.ru:6667 #Code)
;#  Description: The script sets the channel mode (+Dm) to protect against spam/flood bots and requires each 
;#               new visitor and all channel users who do not have "voice" status to enter the correct captcha  
;#               code to obtain the (+v) mode in order to have access to communication on the channel.
;######################################################################

menu channel {
  $+(Captcha Channel Security,$chr(9),$iif(%ccs_work == on,ON,OFF))
  .$iif(%ccs_work == on,$style(1)) ON: %ccs_work = on | ccs_work $chan
  .$iif(%ccs_work == off,$style(1)) OFF: %ccs_work = off | ccs_work $chan
}
alias -l ccs_work {
  if (%ccs_work == on) {
    mode $1 +Dm | .enable #CaptchaChannelSecurity | .timerCCS 0 15 who $1 $+(n,$chr(37),cnf)
    echo -at Captcha Channel Security Script is On! Make 4Sure That everyone is +v
  }
  if (%ccs_work == off) {
    mode $chan -Dm | .disable #CaptchaChannelSecurity | .hfree -sw captcha | .timerCCS off
    echo -at Captcha Channel Security Script is Off!
  }
}

#CaptchaChannelSecurity off
on *:TEXT:*:?:{
  if ($hget(captcha,$nick)) {
    var %hvalue $v1, %chan $gettok(%hvalue,1,32), %answer $gettok(%hvalue,2,32)
    if ($1 == %answer) {
      mode %chan +v $nick | .hdel -sw captcha $nick
      .msg $nick Thank. This is the correct answer. Welcome! You can now chat on the channel $+(,%chan,,.)
    }
  }
}
raw 354:*: if (!$regex($4,[!~&@%+])) captcha_msg $2 $3 | haltdef
raw 352:*: haltdef
raw 301:*: haltdef
raw 315:*: haltdef
alias -l captcha_msg {
  if (!$hget(captcha,$2)) {
    var %captcha $captcha_generator | .hadd $+(-mu,$hash_storage_time) captcha $2 $1 %captcha
    var %t1 ATTENTION: You just tried to join $chan channel $+(,$1,,.)
    var %t2 Since we are attacked by spam/flood Bots, please enter verification code: $+("04,%captcha,") to prove that you're a human.
    var %t3 If you enter the correct answer, you will be allowed to chat on the channel. If you screw up, nothing will happen.
    .msg $2 %t1 %t2 %t3
  }
}
alias -l captcha_generator {
  var %n1 $crand(A,Z,2), %n2 $crand(1,10,2), %n3 $crand(A,Z,3)
  var %n4 $crand(1,10,3), %n5 $crand(A,Z,2), %n6 $crand(1,10,2)
  return $+(%n1,%n2,%n3,%n4,%n5,%n6)
}
alias -l crand { var %v, %i 1 | while (%i <= $3) { %v = $+(%v,$rand($1,$2)) | inc %i } | return %v }
alias -l hash_storage_time { return 900 }
#CaptchaChannelSecurity end

Для активации скрипта необходимо включить его в контекстном меню канала через пункт "Captcha Channel Security".

Обязательно протестируйте этот скрипт, чтобы убедиться в том, что он действительно соответствует вашему запросу и работает так как вы хотели.
Скрипт был протестирован на mIRC v7.75. Дайте мне знать, если что-то будет неисправно или нуждается в улучшении.
https://i.ibb.co/FWqYjt6/ih48ht4rhre.png

[indent=0.8,0.5]
С наступающим Новым Годом!   

Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Channel protection with set (+Dm) modes and enter a captcha for access