Put it on your remotes and set it to enabled mode
It'll kick nicks that has guest on it's front and 5 numbers after that when they join your channel. Since, servers auto change nick when it's registered to other users to something like
Guest67892
so other nicks like
loveguest,imaguest won't be kick.
How about a timed kick if they don't change their nick after a minute or 2?This should do the trick (untested):
on *:KICK:#:.hdel guest $nick
on @*:JOIN:#: {
if (%aguest) && ($regex($nick,/\A(guest\d{5})/i)) && (!$hget(time,$nick)) {
hadd -mz guest $nick 120
.msg $chan $nick $+ , you have about 2 minutes to change your nick!
.timercheck 1 120 kickguest
}
else { ban -ku300 $chan $nick 5 Change your nick before returning! }
}
alias -l kickguest {
var %x = 1
while ($hget(guest,%x).item) {
if ($v1 ison $chan) {
ban -ku300 $chan $v1 5 Failed to change nick!
}
inc %x
}
}
menu menubar,channel {
$iif(%aguest != $false,[On],[Off]) Anti Guests:{
set %aguest $iif(%aguest == $false,$true,$false)
echo -a 4Anti Guests kick is now $iif(%aguest == $true,Enabled,Disabled)
}
}
This script can further be improved a bit from this:
on :join:#:{
if (%aguest) && (Guest iswm $nick) && ($right($nick,5) isnum) {
if $me isop # {
ban -ku300 # $nick 5 Autokick Guest Nicks
}
}
}To this:
on @*:JOIN:#: {
if (%aguest) && ($regex($nick,/\A(guest\d{5})/iS)) {
ban -ku300 # $nick 5 Autokick Guest Nicks
}
}
Where @ means $me isop # and by using regex, it's shorter than using iswm operator and $right() identifier.