Created
December 26, 2021 18:11
-
-
Save westor7/8f3435acdee1402910051cc74b5a0ac1 to your computer and use it in GitHub Desktop.
Repeat Text Warning (3 times) for metin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ON *:TEXT:*:#: { | |
tokenize 32 $strip($1-) | |
var %hash = REPEATS_ $+ $chan | |
var %times = $hget(%hash,$nick $+ _TIMES) | |
var %last_msg = $hget(%hash,$nick $+ _LAST_MSG) | |
var %md5 = $md5($1-,0) | |
if (!%last_msg) { hadd -m %hash $nick $+ _LAST_MSG %md5 | hinc -u3 %hash $nick $+ _TIMES 1 | return } | |
if (%last_msg !== %md5) { hadd -m %hash $nick $+ _LAST_MSG %md5 | hadd -u3 %hash $nick $+ _TIMES 1 | return } | |
hadd -m %hash $nick $+ _LAST_MSG %md5 | |
hinc -u3 %hash $nick $+ _TIMES 1 | |
var %times = $hget(%hash,$nick $+ _TIMES) | |
if (%times == 3) { msg $chan ( $+ $nick $+ ): WARNING! -> Stop repeating the same message here! (3 times so far) | hdel -w %hash $nick $+ _* } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment