mIRC Home    About    Download    Register    News    Help

Print Thread
Autovoice and Devoice Idlers Help #128977 31/08/05 07:28 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
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.

Last edited by craE; 31/08/05 07:48 PM.
Re: Autovoice and Devoice Idlers Help #128978 31/08/05 07:51 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Last edited by SladeKraven; 31/08/05 08:19 PM.
Re: Autovoice and Devoice Idlers Help #128979 31/08/05 08:10 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
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

Re: Autovoice and Devoice Idlers Help #128980 31/08/05 08:21 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Autovoice and Devoice Idlers Help #128981 31/08/05 08:27 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
you rawk!

Re: Autovoice and Devoice Idlers Help #128982 31/08/05 08:34 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
hmm... does seem to be devoicing... any ideas?

or revoicing..

Last edited by craE; 31/08/05 08:45 PM.
Re: Autovoice and Devoice Idlers Help #128983 31/08/05 08:54 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Last edited by SladeKraven; 31/08/05 08:58 PM.
Re: Autovoice and Devoice Idlers Help #128984 31/08/05 09:08 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
are you sure thats the exact code because i get the error

::: Error: There is no such channel (-v)

Re: Autovoice and Devoice Idlers Help #128985 31/08/05 09:16 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Autovoice and Devoice Idlers Help #128986 01/09/05 01:26 AM
Joined: Jun 2003
Posts: 994
C
CtrlAltDel Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
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)

??

Last edited by CtrlAltDel; 01/09/05 01:28 AM.

I refuse to engage in a battle of wits with an unarmed person. wink
Re: Autovoice and Devoice Idlers Help #128987 01/09/05 01:33 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: Autovoice and Devoice Idlers Help #128988 01/09/05 03:37 AM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
thanks everyone works great now

Re: Autovoice and Devoice Idlers Help #128989 01/09/05 04:25 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Your welcome. smile

Re: Autovoice and Devoice Idlers Help #128990 01/09/05 04:02 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
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

Re: Autovoice and Devoice Idlers Help #128991 01/09/05 05:44 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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

Re: Autovoice and Devoice Idlers Help #128992 20/09/05 08:35 AM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
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!

Re: Autovoice and Devoice Idlers Help #128993 20/09/05 07:29 PM
Joined: Aug 2005
Posts: 12
C
craE Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Aug 2005
Posts: 12
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