summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/captcha.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/npc/functions/captcha.txt b/npc/functions/captcha.txt
index 776501c57..cab6f869e 100644
--- a/npc/functions/captcha.txt
+++ b/npc/functions/captcha.txt
@@ -10,6 +10,10 @@
// CAPTCHA_OP$ => The operation, defaults to "+"
// $@BOTCHECK_TARGET => The account ID of the char being probed
// @captcha_cooldown => anti-flood
+// $CAPTCHA (bitmask)
+// 0 - Captcha Disabled
+// 1 - Captcha Enabled
+// 2 - Display warnings (@captcha_lastwarning/@captcha_lastwarningt)
// CaptchName, names the number
function script CaptchName {
@@ -167,6 +171,12 @@ OnTimer5000:
continue;
}
+ // 2.1 Player is AFK for more than 30 seconds
+ if (checkidle() > 30) {
+ detachrid();
+ continue;
+ }
+
// 3. This is a good target, lets do this
.@g$="";
CaptchExample();
@@ -225,6 +235,18 @@ function captchaProbe {
}
// Nothing happened, lets wait
+ if ($CAPTCHA & 2) {
+ if (!@captcha_lastwarningt)
+ @captcha_lastwarningt=3;
+ if (!@captcha_lastwarning)
+ @captcha_lastwarning=gettimetick(2);
+
+ if (@captcha_lastwarning < gettimetick(2)) {
+ dispbottom l("CAPTCHA: You have %s minute(s) remaining", CaptchName(@captcha_lastwarningt));
+ @captcha_lastwarningt-=1;
+ @captcha_lastwarning+=60;
+ }
+ }
return;
}