diff options
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/captcha.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/npc/functions/captcha.txt b/npc/functions/captcha.txt index cab6f869e..9b69ad422 100644 --- a/npc/functions/captcha.txt +++ b/npc/functions/captcha.txt @@ -46,6 +46,7 @@ function script CaptchName { // MakeCaptch, makes a captcha and saves it function script MakeCaptch { CAPTCHA_TIME=gettimetick(2); + CAPTCHA_OK=CAPTCHA_TIME; CAPTCHA_1=rand2(21); CAPTCHA_2=rand2(20); // select a operation @@ -136,14 +137,14 @@ OnInit: // Pick a random target for captcha checks OnTimer5000: - if ($@BOTCHECK_TARGET) captchaProbe(); - // Script disabled by admins if (!$CAPTCHA) { initnpctimer; end; } + if ($@BOTCHECK_TARGET) captchaProbe(); + // Maybe we will conduct a captcha if (rand2(10) < 3) { // This can be slow, beware @@ -156,6 +157,8 @@ OnTimer5000: // Okay, lets do it attachrid(.@players[.@i]); + // TODO: What about jailed players? + // 1. Player in immunity, who is next one if (CAPTCHA_OK > gettimetick(2)) { detachrid(); @@ -226,7 +229,7 @@ function captchaProbe { } // Timer expired? Ban hammer - if (CAPTCHA_TIME+.thr > gettimetick(2)) { + if (CAPTCHA_TIME+.thr > gettimetick(2) && CAPTCHA_OK <= CAPTCHA_TIME) { atcommand("@jailfor 30mn "+strcharinfo(0)); dispbottom l("You failed to reply captcha in time and was arrested for AFK Botting. You can use @jailtime to keep track of time left."); CaptchExample(true); |