mIRC Home    About    Download    Register    News    Help

Print Thread
Autovoice Script #141544 10/02/06 06:35 PM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
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..

Re: Autovoice Script #141545 10/02/06 07:27 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Autovoice Script #141546 11/02/06 02:22 PM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
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.

Re: Autovoice Script #141547 11/02/06 02:35 PM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
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. }
}

Re: Autovoice Script #141548 11/02/06 09:24 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.