Auto Voice

Posted: August 16, 2010 in MiRc Script
Tags:

menu channel {

Auto Voice Timing
.Setting
..$style(2) $+(Detect Text [,%sec,] sec [,%xchatline,] Lines [,$calc(%devoice / 60),] Minute Devoice) $+ : halt
..-
.. Set Detect In Sec: {
.set %sec $$?”User Type In ?? Sec?”
if (!%sec) { .set %sec 120 }
}
..-
..Set Detect Lines: {
.set %xchatline $$?”How Many Lines To Voice?”
if (!%xchatline) { .set %xchatline 10 }
}
..-
..Set Timers For Devoices: {
.set %devoice $$?”Devoice In ?? Minute”
if (%devoice) { .set %devoice $calc(%devoice * 60) }
if (!%devoice) { .set %devoice 300 }
}
..-
..Default:.set %sec 120 | .set %xchatline 10 | .set %devoice 300
.-
.$iif($group(#autovoice) == on,$style(3)) ON:.enable #autovoice
.-
.$iif($group(#autovoice) == off,$style(3)) OFF:.disable #autovoice | .timervoice* off
.-
.Unload Myx Addons:.Unload -rs $script

}
On 1:unload: { .timerdevoice* off | .unset %sec %devoice %xchatline }
On 1:load: { .set %sec 120 | .set %xchatline 10 | .set %devoice 300 }
#autovoice on
On *:text:*:#: { autovoice }
On *:action:*:#: { autovoice }
On *:notice:*:#: { autovoice }
On *:part:#: if ($timer($+(devoice,$nick))) { $+(.timerdevoice,$nick) off }
On *:join:#: if ($timer($+(devoice,$nick))) { .set -u3 %voicenick $addtok(%voicenick,$nick,32) | .timervoice 1 5 mode $chan +v $nick }
On *:nick: {
if ($timer($+(devoice,$nick))) { $+(.timerdevoice,$newnick) 1 $timer($+(devoice,$nick)).secs .mode $gettok($timer($+(devoice,$nick)).com,2,32) -v $newnick | $+(.timerdevoice,$nick) off }
}
alias autovoice {
if ($me isop $chan) {
inc -u $+ %sec $+(%,chat,$nick)
if ($($+(%,chat,$nick),2) == %xchatline) && ($nick isreg $chan) { .mode $chan +v $nick | $+(.timerdevoice,$nick) 1 %devoice .mode $chan -v $nick }
if ($($+(%,chat,$nick),2)) && ($nick isvo $chan) && ($nick !isop $chan) { $+(.timerdevoice,$nick) 1 %devoice .mode $chan -v $nick }
}
}
#autovoice end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s