Skip to content

Instantly share code, notes, and snippets.

@westor7
Created December 26, 2021 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westor7/8f3435acdee1402910051cc74b5a0ac1 to your computer and use it in GitHub Desktop.
Save westor7/8f3435acdee1402910051cc74b5a0ac1 to your computer and use it in GitHub Desktop.
Repeat Text Warning (3 times) for metin
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