::: Repeat Kicker
- The FASTEST Way :::
Written by: [g][e][n][i][u][x]
Date written: May 26, 2001
I have reviewed the article posted by Kintar0 and acclaimed that he has done a
good job out there. However, there is something that
urging me to write out this article purposely for repeating text. I agree with
what Kintar0 have said that many of us done error in creating
repeat kick script. For Kintar0, firstly, i respect your work but i found your
scriplet is quite big by implementing 2 %vars and this will consume
time. We have to remember that TIME is our master. Instead using to many
if...else statement, we can directly use inc -uN %vars. This type
of variables will be automatically removed after N seconds. Here is HOW-TO make
the repeat kicker quite efficient, small and fast.
First, let us create our limiters variables:
alias SetRepeatFlag {
/set %rep.lim 3
/set %rep.t.lim 20
/set %banlevel 3
}
This alias is purposely to set our variables %rep.lim, %rep.t.lim as
the limits and %banlevel as our ban level type. %rep.lim limits
the same
text to scroll for 3 times. %rep.t.lim is the duration for the detection
of the repeating text.
Let me show the coding of the script:-
| on ^@*:TEXT:*:#:{ if ($nick !isreg $chan) { goto end } if (%lockusr- [ $+ [ $chan ] $+ [ $nick ] ]) { haltdef | goto end } inc -u [ $+ [ %rep.t.lim ] ] %rep- [ $+ [ $nick ] $+ . $+ [ $chan ] $+ . $+ [ $len($strip($1-) ] $+ . $+ [ $hash($strip($1-),32) ] ] 1 if (%rep- [ $+ [ $nick ] $+ . $+ [ $chan ] $+ . $+ [ $len($strip($1-) ] $+ . $+ [ $hash($strip($1-),32) ] ] == %rep.lim) { if ($nick ison $chan) { .raw -q kick $chan :Repeating Over Than %rep.lim Times } mode $chan +b $mask($fulladdress,%banlevel) .set -u10 %lockusr- [ $+ [ $chan ] $+ [ $nick ] ] 1 } else goto end :end } |
Yeah, it is quite small, isn't it? Okay, let me describe more about the script that we have made.
First, we have to determine the type of
user that type the text. We usually skip if the nick is an operator, voice
operator and half operator.
Then, I check a variable call %lockusr-
[ $+ [ $chan ] $+ [ $nick ] ] whether it available or not. It will halt the
default text and go to :end skipping out the
next remote. The main variable %rep- [ $+ [ $nick ] $+ . $+ [ $chan ] $+ . $+ [
$len($strip($1-) ] $+ . $+ [ $hash($strip($1-),32) ] ] is automatically created
and
increased if the nick types the same text. Look at the last mIRC identifier
$hash. $hash is purposely to hashing the text with a bit and here i use
32, so the
number we got quite big. Try //echo -a $hash(hello world,32) and see the result.
Next code is the if statement. This statement is to check whether our var
%rep- [ $+ [ $nick ] $+ . $+ [ $chan ] $+ . $+ [ $len($strip($1-) ] $+ . $+ [ $hash($strip($1-),32)
] ] has reached our limit, %rep.lim. If it does, then the next codes
will be run. The nick will be kicked and banned. After that, it creates a
variable %lockusr- [ $+ [ $chan ] $+ [ $nick ] ] and sets it to 1. This variable
act like
/ignore but specifically for the channel. After all, if you still connected to
the server, the variables we created will be gone according to the timer we have
set.
Thus, this script is quite fast as I can assure you. ;)~~ and less time
consuming.