|
Vinniej
|
Vinniej
|
Ok, I don't know why this isnt working... :\ 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..
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
Try this alteration 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.
|
|
|
|
Vinniej
|
Vinniej
|
Try this alteration 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.
|
|
|
|
Vinniej
|
Vinniej
|
I got this one now; 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. } }
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
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.
|
|
|
|
|