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.

voice after so many public chat lines

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
silx
Voice
Posts: 13
Joined: Sat Feb 04, 2006 1:12 am

voice after so many public chat lines

Post by silx »

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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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
s
silx
Voice
Posts: 13
Joined: Sat Feb 04, 2006 1:12 am

Post by silx »

Tcl error [voice:lines]: can't read "users(-----@-------.net)": no such element in array


---- was replaced
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try this:

Code: Select all

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)
  }
}
s
silx
Voice
Posts: 13
Joined: Sat Feb 04, 2006 1:12 am

Post by silx »

that worked :)
thanks alot

anyway to add a public channel command to for users to type to get voice? like. !bot-voiceme
e
eggi
Voice
Posts: 11
Joined: Thu Sep 15, 2005 4:45 pm

Post by eggi »

if the bot s oper bot & not in a op mode then what line i have to replace ??
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

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 ::~!~!~!
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
User avatar
Aditya
Voice
Posts: 8
Joined: Mon May 08, 2006 3:19 am
Location: New York
Contact:

Worth it!

Post by Aditya »

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: Select all

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:

Code: Select all

set voice(len) 120
can be set according to the channel's needs..[/b]
Aditya ( °°)==/ ©

Channel: #TownHall @ DALnet
WebSite: http://www.aditya.coz.in
User avatar
Aditya
Voice
Posts: 8
Joined: Mon May 08, 2006 3:19 am
Location: New York
Contact:

Post by Aditya »

pakistani1 wrote: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
Try This:

http://www.egghelp.org/cgi-bin/tcl_arch ... oad&id=354
Aditya ( °°)==/ ©

Channel: #TownHall @ DALnet
WebSite: http://www.aditya.coz.in
m
mvp1
Voice
Posts: 22
Joined: Thu Jan 27, 2022 4:28 am

Post by mvp1 »

Sir_Fz wrote:Try this:

Code: Select all

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" ?
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)
}
}
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

+v on "x" lines

Post by SpiKe^^ »

See if this helps any...

Code: Select all

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
.
m
mvp1
Voice
Posts: 22
Joined: Thu Jan 27, 2022 4:28 am

Re: +v on "x" lines

Post by mvp1 »

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!*@*}
S
Spartan
Voice
Posts: 6
Joined: Fri Apr 29, 2022 10:19 pm

Hello

Post by Spartan »

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.
s
simo
Revered One
Posts: 1090
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
Post Reply