To add to this here's another way - If you are placing it in a bots mIRC use version 1 if you are placing it in your own mIRC use version 2
Version 1 - To add or delete user from auto voice list you must be a channel op.
VERSION 1
on *:TEXT:*:#:{
if ($1 == !autovoice) && ($nick isop $chan) {
if ($2 == $null) { .notice $nick Command incomplete. Syntax: !autovoice <nick> | halt }
if ($2 !== $null) {
if ($readini(autovoice.ini, $2, AutoVoice) !== $null) { .notice $nick User already exists in the AutoVoice list | halt }
if ($comchan($2,0) == 0) { .notice $nick To add a user you must bring them to a channel were I am too. | halt }
else {
writeini -n autovoice.ini $2 AutoVoice 100
writeini -n autovoice.ini $2 Hostmask $mask($address($2,2),2)
.notice $nick Added $2 to my AutoVoice list.
}
}
}
if ($1 == !DelAutoVoice) && ($nick isop $chan) {
if ($2 == $null) { .notice $nick Command incomplete. Syntax: !DelAutoVoice <nick>. | halt }
if ($2 !== $null) {
if ($readini(autovoice.ini, $2, AutoVoice) == $null) { .notice $nick $2 doesn't appear to be in my autovoice list. | halt }
else {
.remini autovoice.ini $2
.notice $nick AutoVoice for $2 has been removed.
}
}
}
}
on *:JOIN:#:{
if ($readini(autovoice.ini, $nick, AutoVoice) == 100){ .mode $chan +v $nick }
}
Commands :
!AutoVoice nickname -adds user to autovoice list
!DelAutoVoice nickname - Deletes user from autovoice nickname
VERSION 2
alias autovoice {
if ($1 == $null) { .echo -a Command incomplete. Syntax: /autovoice <nick> | halt }
if ($1 !== $null) {
if ($readini(autovoice.ini, $1, AutoVoice) !== $null) { .echo -a User already exists in the AutoVoice list | halt }
if ($comchan($1,0) == 0) { .echo -a To add a user you must bring them to a channel were I am too. | halt }
else {
writeini -n autovoice.ini $1 AutoVoice 100
writeini -n autovoice.ini $1 Hostmask $mask($address($1,2),2)
.echo -a Added $1 to my AutoVoice list.
}
}
}
alias DelAutoVoice {
if ($1 == $null) { .echo -a Command incomplete. Syntax: /DelAutoVoice <nick>. | halt }
if ($1 !== $null) {
if ($readini(autovoice.ini, $1, AutoVoice) == $null) { echo -a $1 doesn't appear to be in my autovoice list. | halt }
else {
.remini autovoice.ini $1
.echo -a AutoVoice for $1 has been removed.
}
}
}
on *:JOIN:#:{
if ($readini(autovoice.ini, $nick, AutoVoice) == 100){ .mode $chan +v $nick }
}
Commands:
/autovoice nickname - Adds nickname to auto voice list
/DelAutoVoice nickname - Deletes nickname from auto voice list