This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Auto Voice & Devoice!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Auto Voice & Devoice!

Post by i_m_offline »

Hello friends,

Can I get an tcl script which does following:

Voice users on x number of lines said in main channel
Devoice user upon being idle in channel for x minuts (idle time in channel, not on server)

Couldn't find setisfying script on google and on site so asking here. Thanking in advance :D

i_m_offline
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set num 10 ;# lines
set idle 5 ;# minutes
bind pubm - * foo
bind time - * bar
proc foo {n u h c t} {
	if [info exists ::user($n)] {
		if {[incr ::user($n)] >= $::num && ![isvoice $n $c]} {
			pushmode $c +v $n
		}
	} {
		set ::user($n) 1
	}
}
proc bar {m h d mo y} {
	foreach c [channels] {
		foreach n [chanlist $c] {
			if {[isvoice $n $c] && [getchanidle $n $c] >= $::idle} {
				pushmode $c -v $n
			}
		}
	}
}
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Thanks

Post by i_m_offline »

Ohhh thats so kind of u demond! Thanks alot.

Sorrie for asking for more but is it possible to add any nick in exempt list so that they dont get voiced in channel, whatever number of lines they use. THanks once more

just to make it more specific
set num 10 ;# lines
set idle 5 ;# minutes

YOu here 10 lines and 5 min is idle time, and I can change it to whatever I want ?

THanks

i_m_offline
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

One more thing!

Post by i_m_offline »

How often it will check for idle users ?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: One more thing!

Post by Sir_Fz »

i_m_offline wrote:How often it will check for idle users ?
Every minute
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Thanks Demond

Post by i_m_offline »

The code is working perfectly all right, its just if you can add lil more in it where I can exempt few nicks from getting voiced. Thanks once more :D

Just to ask u, when v define x number of lines said in channel, would get voiced, so these x number of lines has some time limit ? like 10 lines in 15 min then voiced or somthing ? o/w if a user get voice for saying 100 lines in 3 days then :s sounds lil tricky. thanks again mate :)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

for an except list, you better use user-defined flag, for example A:

Code: Select all

proc foo {n u h c t} {
   if [matchattr $h A] return
...
then add nicks/hostmask you don't want voiced to a user record chattr'ed +A

as of the line counting timelimit, there is none (and I am too lazy to implement one for you)
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Post by i_m_offline »

All right Demond, that was a gr8 help too :) appreciated, I shall wait for u to feel relax then I might have that :) so I will be looking into mypost for the response. I feel if there is no time limit defined then the purpose of it may not give the right results. I would request if it can be set by user, would like more friendly, like anyone can define x many lines in x minutes then voiced. :)
Author -> "demond"

hahaha :p ok no buttering :)

Have a nice time all, will be looking after for the update :) thanks

i_m_offline
DALnet
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Post by i_m_offline »

daym mate, the script is voicing a person on one line itself when that person joins next, because it doesn't clear the variable (I think) and its voicing even to OPs :( can u please sort this out? thanks :)

i_m_offline
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

no, I won't fix the script, so stop asking already

IMO, it's fair to remember the number of lines for a nick between joins - that is, for a reasonable amount of time - and if you want that purged after certain amount of time, implement it yourself - I don't develop scripts which serve no sane purpose - and this script is such a script - since voicing users on a channel that is not +m is a pure vanity (and lameness)
i
i_m_offline
Voice
Posts: 21
Joined: Sat Jun 18, 2005 4:20 am

Post by i_m_offline »

eh ok :s :(
Thanks for whatever u did :)
d
dohko2006
Voice
Posts: 8
Joined: Sun Mar 19, 2006 2:16 pm

Post by dohko2006 »

sorry for open past topic, but and try to modify myfelf and get errors.
i try only devoice inactive voices (delay from server), but protect +g and +f

my code

Code: Select all

set idle 30 ;# minutes 

bind time - * bar 

proc bar {m h d mo y handle} { 
   foreach c [channels] { 
      foreach n [chanlist $c] { 
         if { ![matchattr $handle gf] && [isvoice $n $c] && [getchanidle $n $c] >= $::idle} { 
            pushmode $c -v $n 
         } 
      } 
   } 
} 
and always have this error:

Code: Select all

Tcl error [bar]: wrong # args: should be "bar m h d mo y handle"
add, its possible modify check intervals of delay (now its every minute) to every 5mins per example?

Regards :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

set idle 30 ;# minutes

bind time - * bar

proc bar args {
   foreach c [channels] {
      foreach n [chanlist $c] {
         set handle [nick2hand $n $c]
         if {![matchattr $handle gf] && [isvoice $n $c] && [getchanidle $n $c] >= $::idle} {
            pushmode $c -v $n
         }
      }
   }
}
d
dohko2006
Voice
Posts: 8
Joined: Sun Mar 19, 2006 2:16 pm

Post by dohko2006 »

Sir your the best! Works Fine now... thx a lot ^^
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

i m getting a problem
if some one become idle for 30 min who was voiced, get his +v again after just a singel word or line !!

& how can we use it in some silected channel only?
Sir_Fz wrote:Try

Code: Select all

set idle 30 ;# minutes

bind time - * bar

proc bar args {
   foreach c [channels] {
      foreach n [chanlist $c] {
         set handle [nick2hand $n $c]
         if {![matchattr $handle gf] && [isvoice $n $c] && [getchanidle $n $c] >= $::idle} {
            pushmode $c -v $n
         }
      }
   }
}
Post Reply