This is a very simple and basic channel limiter for your IRC channel(s). It could be written to include better features or something, but this script does work and it gets the job done.
Please don't criticize my work. You can leave comments but don't say things like "this script sucks, there are better ones". If you don't have anything nice to say, don't say anything at all, seriously.
Basically whenever a user joins your channel, the script sets +l on the given channel (if +l isn't already set on the channel). It uses $nick() to return the total number of nicks on the channel and then increases the user limit by 1 every 30 seconds after a user joins. When a user parts or quits, the script uses $chan() to return the +l limit and uses $calc to reduce that number by 1.
The script also re-enables the +l channel mode if another operator disables it, even if they specify a list of modes to disable (e.g. -qoahkl).
Very effective and it works great. Please enjoy, and feel free to post comments and ideas on how to make it better!
(note: you must change '#chan' in the script to your channel name!)
on *:JOIN:#chan: {
set %usernum $nick(#chan,0)
.timer 1 30 mode #chan +l $calc($nick(#chan,0) + 2)
}
on *:PART:#chan: {
.timer 1 30 mode #chan +l $calc($chan(#chan).limit - 1)
}
on *:QUIT: {
if ($chan(#chan).limit) && (%usernum < $nick(#chan,0)) {
.timer 1 30 mode #chan +l $calc($chan(#chan).limit - 1)
}
}
on *:MODE:#chan: {
if ($left($1,1) == $chr(45)) && (l isin $1) {
mode #chan +l $calc($nick(#chan,0) + 2)
}
}