| View previous topic :: View next topic |
| Author |
Message |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Sun Jun 19, 2005 11:54 am Post subject: Auto Voice & Devoice! |
|
|
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
i_m_offline |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jun 19, 2005 12:21 pm Post subject: |
|
|
| Code: |
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
}
}
}
}
|
|
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Sun Jun 19, 2005 4:07 pm Post subject: Thanks |
|
|
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 |
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Sun Jun 19, 2005 4:11 pm Post subject: One more thing! |
|
|
| How often it will check for idle users ? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Jun 19, 2005 6:08 pm Post subject: Re: One more thing! |
|
|
| i_m_offline wrote: | | How often it will check for idle users ? |
Every minute _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Tue Jun 21, 2005 3:10 am Post subject: Thanks Demond |
|
|
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
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  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Jun 21, 2005 4:21 am Post subject: |
|
|
for an except list, you better use user-defined flag, for example A:
| Code: |
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) |
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Tue Jun 21, 2005 5:47 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Tue Jun 21, 2005 11:45 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Jun 21, 2005 12:03 pm Post subject: |
|
|
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) |
|
| Back to top |
|
 |
i_m_offline Voice
Joined: 18 Jun 2005 Posts: 21
|
Posted: Tue Jun 21, 2005 12:08 pm Post subject: |
|
|
eh ok :s
Thanks for whatever u did  |
|
| Back to top |
|
 |
dohko2006 Voice
Joined: 19 Mar 2006 Posts: 8
|
Posted: Sun Mar 26, 2006 2:13 pm Post subject: |
|
|
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: |
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: | | 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  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 26, 2006 9:10 pm Post subject: |
|
|
Try
| Code: | 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
}
}
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
dohko2006 Voice
Joined: 19 Mar 2006 Posts: 8
|
Posted: Mon Mar 27, 2006 12:29 pm Post subject: |
|
|
| Sir your the best! Works Fine now... thx a lot ^^ |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Thu Apr 20, 2006 3:29 pm Post subject: |
|
|
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: | 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
}
}
}
} |
|
_________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
|