mIRC Homepage

Autovoice Script

Posted By: Vinniej

Autovoice Script - 10/02/06 06:35 PM

Ok, I don't know why this isnt working... :\

Quote:
on *:join:#: {
if (%autovoice $+ $chan == on) { mode # +v $nick }
else { halt }
}
on 1000:text:.av *:#: {
if ($2 == on) { set %autovoice $+ $chan on | notice $nick Done. }
elseif ($2 == off) { set %autovoice $+ $chan off | notice $nick Done. }
}


I just want to know what is wrong, maybe I can learn something, again..
Posted By: RusselB

Re: Autovoice Script - 10/02/06 07:27 PM

Try this alteration
Code:
on @*:join:#:{
if $+(%,autovoice,.,$chan) { .mode # +v $nick }
}
on 1000:text:.av:#:{
set $+(%,autovoice,.,$chan) $iif(!$($+(%,autovoice,.,$chan),2),$true,$false)
.notice $nick Auto-Voice for $chan is $iif(!$($+(%,autovoice,.,$chan),2),on,off)
}
 

The above code uses the .av text as a simple on/off switch.
If the auto-voice is on and someone with level 1000 uses the .av command then it turns off, and vice-versa

I can see the following possibilities with your original code.
1) the fact that to set the Voice mode one has to have ops, and you don't check for that.
2) No one has a user level of 1000 to be able to turn the auto-voice on or off.
NOTE: This last item will also cause my code to fail.
Posted By: Vinniej

Re: Autovoice Script - 11/02/06 02:22 PM

Quote:
Try this alteration
Code:
on @*:join:#:{
if $+(%,autovoice,.,$chan) { .mode # +v $nick }
}
on 1000:text:.av:#:{
set $+(%,autovoice,.,$chan) $iif(!$($+(%,autovoice,.,$chan),2),$true,$false)
.notice $nick Auto-Voice for $chan is $iif(!$($+(%,autovoice,.,$chan),2),on,off)
}
 

The above code uses the .av text as a simple on/off switch.
If the auto-voice is on and someone with level 1000 uses the .av command then it turns off, and vice-versa

I can see the following possibilities with your original code.
1) the fact that to set the Voice mode one has to have ops, and you don't check for that.
2) No one has a user level of 1000 to be able to turn the auto-voice on or off.
NOTE: This last item will also cause my code to fail.
This code gives voice in every channel when I enable it in a channel. I got to deactivate it first. But its useless when I have to deactivate it first in a channel.
Posted By: Vinniej

Re: Autovoice Script - 11/02/06 02:35 PM

I got this one now;

Quote:
on *:join:#: {
if (%autovoice == $chan on) { mode # +v $nick }
else { halt }
}
on 1000:text:.av *:#: {
if ($2 == on) { set %autovoice $chan on | notice $nick Done. }
elseif ($2 == off) { set %autovoice $chan off | notice $nick Done. }
}
Posted By: RusselB

Re: Autovoice Script - 11/02/06 09:24 PM

Code:
on @!*:join:#:{
if ($+(%,autovoice,.,$chan) == $chan) { .mode # +v $nick }
}
on me:*:join:#:{
unset $+(%,autovoice,.,$chan)
}
on 1000:text:.av:#:{
set $+(%,autovoice,.,$chan) $iif(!$($+(%,autovoice,.,$chan),2),$chan,$false)
.notice $nick Auto-Voice for $chan is $iif(!$($+(%,autovoice,.,$chan),2),on,off)
}
  


That should resolve the problems you mentioned with my code. Your current code is almost identical to the code you started with. The code defaults to an off position when you join a channel, but once on, it stays on until you turn it off or leave the channel.
© 2021 mIRC Discussion Forums