View previous topic :: View next topic |
Author |
Message |
silx Voice
Joined: 04 Feb 2006 Posts: 13
|
Posted: Sat Feb 04, 2006 1:14 am Post subject: voice after so many public chat lines |
|
|
need something that will auto voice people after a set number of lines that person has typed in a public channel.
or if that cannot be done.
voice after xx minutes on a channel
plz help |
|
Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Feb 04, 2006 2:53 am Post subject: |
|
|
Code: | set lines 10
array set users {}
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global users lines
if {![info exists users($host)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
set users($host) 1
} elseif {[expr $users($host) + 1] >= $lines} {
pushmode $chan +v $nick; unset users($host)
} else {
incr users($host)
}
} |
This should work like you wanted it too |
|
Back to top |
|
 |
silx Voice
Joined: 04 Feb 2006 Posts: 13
|
Posted: Sat Feb 04, 2006 4:58 am Post subject: |
|
|
Tcl error [voice:lines]: can't read "users(-----@-------.net)": no such element in array
---- was replaced |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Feb 04, 2006 10:37 am Post subject: |
|
|
Try this:
Code: | set lines 10
array set users {}
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global users lines
if {![info exists users($host)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
set users($host) 1
} elseif {[info exists users($host)] && [expr $users($host) + 1] >= $lines} {
pushmode $chan +v $nick; unset users($host)
} elseif {[info exists users($host)]} {
incr users($host)
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
silx Voice
Joined: 04 Feb 2006 Posts: 13
|
Posted: Sat Feb 04, 2006 1:56 pm Post subject: |
|
|
that worked
thanks alot
anyway to add a public channel command to for users to type to get voice? like. !bot-voiceme |
|
Back to top |
|
 |
eggi Voice
Joined: 15 Sep 2005 Posts: 11
|
Posted: Sat Feb 04, 2006 3:04 pm Post subject: |
|
|
if the bot s oper bot & not in a op mode then what line i have to replace ?? |
|
Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Wed Jul 19, 2006 4:23 pm Post subject: |
|
|
what if we want the bot to devoice the nick after some idle time .. lets say 2 minutes .. idle after being voiced after writing 10 lines ..
and after the devoice the line count should again go to 0..
thanx _________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3743 Location: Mint Factory
|
Posted: Fri Jul 21, 2006 1:12 pm Post subject: |
|
|
I for one would go for a md5 hash with the nick!ident@host, and splt, part, quit, etc. binds to remove them from the list. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
Aditya Voice

Joined: 08 May 2006 Posts: 8 Location: New York
|
Posted: Tue Jul 25, 2006 4:38 am Post subject: Worth it! |
|
|
With a Script like "Voice On Lines" a Person Culd gain voice with just typing
1
2
3
4
5
6
7
8
9
10
Its better to always have something like 'voice on characters'
I made one for myself long before.. try it
Code: | set voice(len) 120
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global voice
if {[string length $arguments] > $voice(len)} {
if {![isvoice $nick $chan] || ![isop $nick $chan]} {
pushmode $chan +v $nick
}
}
}
|
Note: can be set according to the channel's needs.. _________________ Aditya ( °°)==/ ©
Channel: #TownHall @ DALnet
WebSite: http://www.aditya.coz.in |
|
Back to top |
|
 |
Aditya Voice

Joined: 08 May 2006 Posts: 8 Location: New York
|
|
Back to top |
|
 |
mvp1 Voice
Joined: 27 Jan 2022 Posts: 22
|
Posted: Sun May 08, 2022 7:55 pm Post subject: |
|
|
Sir_Fz wrote: | Try this:
Code: | set lines 10
array set users {}
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global users lines
if {![info exists users($host)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
set users($host) 1
} elseif {[info exists users($host)] && [expr $users($host) + 1] >= $lines} {
pushmode $chan +v $nick; unset users($host)
} elseif {[info exists users($host)]} {
incr users($host)
}
} |
|
Hi guys, thanks for this. I am using below code and it's working fine. Is there a way I could add a specific nick in this code which is an exception and not to be voiced after 5 lines? For example "specificnick1" ?
Quote: |
set lines 5
array set users {}
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global users lines
if {![info exists users($host)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
set users($host) 1
} elseif {[info exists users($host)] && [expr $users($host) + 1] >= $lines} {
pushmode $chan +v $nick; unset users($host)
} elseif {[info exists users($host)]} {
incr users($host)
}
} |
|
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 809 Location: Tennessee, USA
|
Posted: Sun May 08, 2022 11:19 pm Post subject: +v on "x" lines |
|
|
See if this helps any... Code: |
set lines 10
# Exempt hostmask(s) to not voice
# example: set exemptmasks {myNick!*@* *!*@*.sumhost.com}
# Note: set empty to disable any masks checking
set exemptmasks {specificnick1!*@*}
array set users {}
bind pubm - * voice:lines
proc voice:lines {nick host hand chan arguments} {
global users lines exemptmasks
foreach xmask [split [string trim $exemptmasks]] { ;# check if Exempt Hostmask #
if {[matchaddr $xmask ${nick}!$host]} { return 0 }
}
if {![info exists users($host)] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
set users($host) 1
} elseif {[info exists users($host)] && [expr $users($host) + 1] >= $lines} {
pushmode $chan +v $nick; unset users($host)
} elseif {[info exists users($host)]} {
incr users($host)
}
}
|
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
Back to top |
|
 |
mvp1 Voice
Joined: 27 Jan 2022 Posts: 22
|
Posted: Mon May 09, 2022 12:19 am Post subject: Re: +v on "x" lines |
|
|
Cheers Spike mate, will test this and let you know. Quick question; Any chance this would work for more than one exceptions nick? e.g specificnick1 , specificnick2 and so on.. if I only change below as?
set exemptmasks {specificnick1!*@* specificnick2!*@* specificnick3!*@*} |
|
Back to top |
|
 |
Spartan Voice
Joined: 29 Apr 2022 Posts: 5
|
Posted: Wed May 11, 2022 4:52 am Post subject: Hello |
|
|
Is better the bot to give voice to the user who have 15 min and up who talk in channel not from 5 line, and if user doesnt talk 30 min in channel to devoice
also to check if the users is blacklist to not get voice. |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Mon May 23, 2022 9:49 am Post subject: |
|
|
it would probably be a good idea as Spartan suggested to add a check how long the nick has been in channel for example 5 or 10 min to make sure abusers and flooders dont get voiced altho abusers and flooders can be in channel after 5 or 10 min but usually they join and want to abuse/flood right away and therefor get removed so the script shouldnt consider them as they are prob removed before threshold is reached
this is a usefull code in the case of massive abuse or floods and the channel is set to +m or +M so the regular active chatters can resume chatting |
|
Back to top |
|
 |
|