Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:*:#: {
- tokenize 32 $strip($1-)
- var %coms = !spam,!spaminfo,!spamstop
- if ($istok(%coms,$1,44)) || ($mod) { goto commands }
- if ($evalnext($+(%,flood_,$chan,_reset))) { var %d = $evalnext($+(%,flood_,$chan,_reset)) }
- inc $+(-eu,$iif(%d,$v1,10)) %flood_ $+ $chan $+ _ $+ $nick $+ _spam 1
- if ($evalnext($+(%,flood_,$chan,_times))) && ($evalnext($+(%,flood_,$chan,_seconds))) && ($evalnext($+(%,flood_,$chan,_,$nick,_spam)) > $evalnext($+(%,flood_,$chan,_times))) {
- unset $+(%,flood_,$chan,_,$nick,_spam)
- msg $chan .timeout $nick 1
- return
- }
- :commands
- if ($1 == !spam) {
- if (!$mod) { .msg $chan ( $+ $nick $+ ): Error, You have not access for that command, limited to moderators! | return }
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify the messages times! | return }
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please specify the messages seconds! | return }
- if ($4) && ($isdigit($4)) { var %d = $4 }
- if (!$isdigit($2)) { .msg $chan ( $+ $nick $+ ): Error, Please specify only digital numbers as messages times! | return }
- if (!$isdigit($3)) { .msg $chan ( $+ $nick $+ ): Error, Please specify only digital numbers as messages seconds! | return }
- set %flood_ $+ $chan $+ _times $2
- set %flood_ $+ $chan $+ _seconds $3
- if (%d) { set %flood_ $+ $chan $+ _reset $4 }
- elseif (!%d) { unset $+(%,flood_,$chan,_reset) }
- .msg $chan ( $+ $nick $+ ): The Flood Protection has been set as $2 messages in $3 seconds, resetting idle message set $iif(%d,$v1,10 as default) $+ .
- }
- if ($1 == !spaminfo) {
- if (!$mod) { .msg $chan ( $+ $nick $+ ): Error, You have not access for that command, limited to moderators! | return }
- var %t = $evalnext($+(%,flood_,$chan,_times))
- var %m = $evalnext($+(%,flood_,$chan,_seconds))
- var %r = $evalnext($+(%,flood_,$chan,_reset))
- if (!%t) && (!%m) { .msg $chan ( $+ $nick $+ ): You have not set any Flood Protection settings yet! }
- else { .msg $chan ( $+ $nick $+ ): Your channel Flood Protection settings are %t times per %m seconds with $iif(%r,$v1,10) seconds of idle reset time. }
- }
- if ($1 == !spamstop) {
- if (!$mod) { .msg $chan ( $+ $nick $+ ): Error, You have not access for that command, limited to moderators! | return }
- if (!$evalnext($+(%,flood_,$chan,_times))) && (!$evalnext($+(%,flood_,$chan,_seconds))) { .msg $chan ( $+ $nick $+ ): The Flood Protections doesn't actually running on this channel! }
- else {
- unset $+(%,flood_,$chan,_*)
- .msg $chan ( $+ $nick $+ ): The Flood Protection has been stopped and resetted for that channel!
- }
- }
- }
- alias -l mod { return $iif($msgtags(user-type).key == mod || $mid(#, 2-) == $nick, $true) }
- alias -l isdigit {
- if (!$isid) { return }
- if ($1 == $null) { return 0 }
- if ($regex($1,^\d+$)) { return 1 }
- else { return 0 }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement