mIRC Homepage
Posted By: craE Autovoice and Devoice Idlers Help - 31/08/05 07:28 PM
ok i was wondering if some one could show me how to do this, the idea is too auto voice everyone that comes into the channel and then devoices a person if they are idle for 20 mins or more. there is an example here but this is for an eggdrop and i want this to be a stand alone IRC script. Thanks in advance.

Sample eggdrop code:

http://purepistos.net/eggdrop/reby/voicer.rb

one other thing as soon as they speak again i would like it to revoice them.
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 31/08/05 07:51 PM
I hope this works out for you..

Code:
On @*:Join:[color:red]#ChannelHere[/color]: { 
  if ($nick == $me) {
    .timerAV 0 10 autovoice $chan
  }
  else {
    mode $chan +v $nick
  }
}

On me:*:Part:[color:red]#ChannelHere[/color]: {.timerAV off }
On @*:Text:*:[color:red]#ChannelHere[/color]: { 
  if ($nick isreg $chan) mode $chan +v $nick 
}

alias autovoice {
  var %x = $nick($1,0)
  while (%x) {
    if (($nick($1,%x).idle >= 1200) && ($nick($1,%x) != $me)) {
      if ($me isop $1) mode $chan -v $nick
    }
    dec %x
  }
}


**Code Untested**

-Andy
Posted By: craE Re: Autovoice and Devoice Idlers Help - 31/08/05 08:10 PM
thanks man i dunno if you saw the update im testing it right now thanks alot i know im asking alot but if there is a way to make it specific for one channel and like i said, i would like the script to revoice as soon as some one who is devoiced speaks


thanks alot though for your help. grin
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 31/08/05 08:21 PM
It's now channel specific, and I did include the voice when they speak too. smile

Look above for the edited code:

* Change #ChannelHere to your channel name.

-Andy
Posted By: craE Re: Autovoice and Devoice Idlers Help - 31/08/05 08:27 PM
you rawk!
Posted By: craE Re: Autovoice and Devoice Idlers Help - 31/08/05 08:34 PM
hmm... does seem to be devoicing... any ideas?

or revoicing..
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 31/08/05 08:54 PM
Yeah sorry dude, glitch on my part.

[14:50] * Andy has joined #tscripts
[14:50] * SladeKraven sets mode: +v Andy
[14:50] * SladeKraven sets mode: -v Andy
[14:50] <Andy> Dude, I'm present... Give me back my voice!
[14:50] * SladeKraven sets mode: +v Andy

Code:
On *:Join:[color:red]#ChannelHere[/color]: { 
  if ($nick == $me) {
    .timerAV 0 10 autovoice $chan
  }
  else {
    mode $chan +v $nick
  }
}

On me:*:Part:[color:red]#ChannelHere[/color]: { .timerAV off }
On @*:Text:*:[color:red]#ChannelHere[/color]: { 
  if ($nick isreg $chan) mode $chan +v $nick 
}

alias autovoice {
  var %x = $nick($1,0)
  while (%x) {
    if (($nick($1,%x).idle &gt;= 1200) &amp;&amp; ($nick($1,%x) != $me)) {
      if ($me isop $1) mode $v2 -v $nick($1,%x)
    }
    dec %x
  }
}


20 minutes is rather along duration to wait to see if it works decrease the number to about 20 seconds. smile

Edit: In my code above this one the errors were $chan had no value and the nickname would have been $nick($1,%x) not $nick.

-Andy
Posted By: craE Re: Autovoice and Devoice Idlers Help - 31/08/05 09:08 PM
are you sure thats the exact code because i get the error

::: Error: There is no such channel (-v)
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 31/08/05 09:16 PM
The last code I posted works perfectly for me dude. Strange that it wont for you..

[15:12] * SladeKraven sets mode: -v Andy
[15:12] <Andy> present..
[15:12] * SladeKraven sets mode: +v Andy
[15:13] * SladeKraven sets mode: -v Andy
[15:14] <SladeKraven> I'm here..
[15:14] <Andy> Darn. Wrong mIRC, I'm also here..
[15:14] * SladeKraven sets mode: +v Andy

-Andy
Posted By: CtrlAltDel Re: Autovoice and Devoice Idlers Help - 01/09/05 01:26 AM
shouldn't this:

if ($me isop $1) mode $v2 -v $nick($1,%x)

actually be this:

if ($me isop $1) mode $1 -v $nick($1,%x)

??
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 01/09/05 01:33 AM
I guess it'd depend on their version.

if ($me isop $1) mode $v2 -v $nick($1,%x)

We're checking if we're an op on $1 before we devoice them. In that IF statement $1 is $v2. /autovoice #ChannelHere as you can see $1 would be the channel.

So, for those who aren't using 6.16 mIRC version could use:

if ($me isop $1) mode $1 -v $nick($1,%x)

Edit: Posted and didn't see the reply from when you changed the #ChannelHere.. smile

-Andy
Posted By: craE Re: Autovoice and Devoice Idlers Help - 01/09/05 03:37 AM
thanks everyone works great now
Posted By: SladeKraven Re: Autovoice and Devoice Idlers Help - 01/09/05 04:25 AM
Your welcome. smile
Posted By: craE Re: Autovoice and Devoice Idlers Help - 01/09/05 04:02 PM
uh oh a new day and a new challenge smirk

ok script works good but after further testing i noticed it will keep devoicing people if they remain silent ie:

—› mode: (craE) sets (-v LordMael)
—› mode: (craE) sets (-v LordMael)
—› mode: (craE) sets (-v LordMael)

and one other thing is there a way that you can make it not auto voice on join but as soon as they speak and not just anything but they have to speak at least say... 15 charaters? thasnks again lets see wink
Posted By: Kelder Re: Autovoice and Devoice Idlers Help - 01/09/05 05:44 PM
Code:
on me:*:JOIN:#channelhere:.timerAV. $+ $chan 0 10 autovoice $chan
on me:*:PART:#ChannelHere:.timerAV. $+ chan off
on @*:TEXT:*:#ChannelHere:{
  if (($nick isreg $chan) &amp;&amp; ($len($1-) &gt;= 15)) mode $chan +v $nick 
}
alias autovoice {
  if ($me !isop $1) return
  var %x = $nick($1,0), %idlers
  while (%x) {
    if (($nick($1,%x).idle &gt;= 1200) &amp;&amp; ($nick($1,%x) isvoice $1)) {
      var %idlers = %idlers $nick($1,%x)
      if ($numtok(%idlers,32) == $modespl) {
        mode $1 $+(-,$str(v,$numtok(%idlers,32)) %idlers
        var %idlers
      }
    }
    dec %x
  }
  if (%idlers) mode $1 $+(-,$str(v,$numtok(%idlers,32)) %idlers
}


Yes, you will devoice yourself if you're idle too long :tongue: Luckily you're op, so noone will see that + anyways smile


I included something to queue those modes so that you can get one combined
* me sets mode -vvvv idler1 idler2 idler3 idler4
instead of 4 single modes. Makes it less likely to get flooded too...

ps: upgrade mIRC to version 6.16, makes it a lot more fun to script with $v1 and $v2 smile
Posted By: craE Re: Autovoice and Devoice Idlers Help - 20/09/05 08:35 AM
ok not only is this a bump**

the last script works great up until the devoicing part, it just doesnt do it, also a side note on the testing i upgraded to 6.16 like you all said to see if that would make it work, it didnt. so please try and hhelp fix this thanks!
Posted By: craE Re: Autovoice and Devoice Idlers Help - 20/09/05 07:29 PM
Bump
Invalid format: $+ (line 19,script1.mrc)

this is what i keep getting as an error please some one help mei know it is referring to this line

if (%idlers) mode $1 $+(-,$str(v,$numtok(%idlers,32)) %idlers

thanks
© mIRC Discussion Forums