Oops... looks like I was in a hurry with the publication, and then I couldn't make a correction to the post for a long time and went away on business. I based it on the code snippet you provided with "
ON INPUT", but when edited it forgot to add the important condition
if (/* !iswm $1)
that was present in my previous code. This condition checks whether the entered text is a regular message or a command where the first character in the first word is "
/", for example, if you enter the command:
/echo -a test
. Just in case, need to add.
Also, the command "
halt" at the end of the code will block any sent messages sent to the channel other than the listed commands, so this should be removed or can add inside the curly braces at the very end for each command:
if (!k == $1) { kick $chan $2 $3- | halt }
so that the entered command is not sent to the channel and is not visible to users.
And finally, it is better to remove the prefix "
@" in the event handler, since it is assumed that some commands used to obtain the channel operator status will be entered at a time when you do not yet have the channel operator status.
During my short, rushed testing, everything went smoothly and I didn't notice these bloopers, but these omissions lead to the script not working correctly.
Replace the previous code snippet with the "
ON INPUT" event handler with this one and check:
on *:INPUT:#:{
if (/* !iswm $1) {
if (!q == $1) {
if ($2 == $null) { msg chanserv owner $chan $me } | else { mode $chan +q $2- } | halt
}
if (!a == $1) {
if ($2 == $null) { msg chanserv protect $chan $me } | else { mode $chan +aaaaaaaaaa $2- } | halt
}
if (!o == $1) {
if ($2 == $null) { msg chanserv op $chan $me } | else { mode $chan +oooooooooo $2- } | halt
}
if (!kb == $1) { ban -k $chan $2 2 You are not welcome here! | halt }
if (!k == $1) { kick $chan $2 $3- | halt }
if (.k == $1) { kick $chan $2 $3- | halt }
if (!b == $1 ) { mode $chan +b $+(*,$2,*!*@*) | halt }
if (.b == $1 ) { ban $chan $2 $3- | halt }
if (!br == $1) { bacc $chan $2 | halt }
if (!kbr == $1) { bacc $chan $2 | kick $chan $2 You are not welcome here! | halt }
}
}