The code allows you to control autovoice options for multiple channels. Pretty simple, posted mainly as an example to learn from.
on *:TEXT:!Autovoice*:#: {
if ($2 == $null) {
notice $nick Please enter a setting for the autovoice e.g !Autovoice [On|Off]
}
elseif ($nick !isop $chan) {
notice $nick You must be an op to set the autovoice settings for #
}
elseif ($2 == $readini(autovoice.ini, $chan, setting)) {
notice $nick Your setting is already set to $readini(autovoice.ini, $chan $+ , setting)
}
elseif ($2 == on) {
/writeini autovoice.ini $chan setting $2
notice $nick Autovoice settings for $chan set to: $2
}
elseif ($2 == off) {
/writeini -n autovoice.ini $chan setting $2
notice $nick Autovoice settings for $chan set to: $2
}
}
on *:join:#: {
if ($readini(autovoice.ini, $chan, setting) == on) && ($me isop $chan) {
/mode $chan +v $nick
}
elseif ($readini(autovoice.ini, $chan, setting) == on) && ($me ishop $chan) {
/mode $chan +v $nick
}
}