summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-28 23:40:18 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-28 23:40:18 -0300
commit4b110c5b992f196ff37f7eb4d440e7fe43f3800d (patch)
treef2e2cac7080d8967bf8a223696d618798ace349b /npc/functions
parent512d67bfabc4a1aa72462a515e6aa9af5dd0309d (diff)
downloadserverdata-4b110c5b992f196ff37f7eb4d440e7fe43f3800d.tar.gz
serverdata-4b110c5b992f196ff37f7eb4d440e7fe43f3800d.tar.bz2
serverdata-4b110c5b992f196ff37f7eb4d440e7fe43f3800d.tar.xz
serverdata-4b110c5b992f196ff37f7eb4d440e7fe43f3800d.zip
Forgive idlers, optional captcha mode 2/3 which displays warnings
Diffstat (limited to 'npc/functions')
-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;
}