egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

voice after so many public chat lines
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
silx
Voice


Joined: 04 Feb 2006
Posts: 13

PostPosted: Sat Feb 04, 2006 1:14 am    Post subject: voice after so many public chat lines Reply with quote

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
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Feb 04, 2006 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message
silx
Voice


Joined: 04 Feb 2006
Posts: 13

PostPosted: Sat Feb 04, 2006 4:58 am    Post subject: Reply with quote

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


---- was replaced
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Feb 04, 2006 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
silx
Voice


Joined: 04 Feb 2006
Posts: 13

PostPosted: Sat Feb 04, 2006 1:56 pm    Post subject: Reply with quote

that worked Smile
thanks alot

anyway to add a public channel command to for users to type to get voice? like. !bot-voiceme
Back to top
View user's profile Send private message
eggi
Voice


Joined: 15 Sep 2005
Posts: 11

PostPosted: Sat Feb 04, 2006 3:04 pm    Post subject: Reply with quote

if the bot s oper bot & not in a op mode then what line i have to replace ??
Back to top
View user's profile Send private message
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Wed Jul 19, 2006 4:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Fri Jul 21, 2006 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aditya
Voice


Joined: 08 May 2006
Posts: 8
Location: New York

PostPosted: Tue Jul 25, 2006 4:38 am    Post subject: Worth it! Reply with quote

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

Smile Its better to always have something like 'voice on characters'

I made one for myself long before.. try it Smile

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:
Code:
set voice(len) 120
can be set according to the channel's needs..
_________________
Aditya ( )==/

Channel: #TownHall @ DALnet
WebSite: http://www.aditya.coz.in
Back to top
View user's profile Send private message Visit poster's website
Aditya
Voice


Joined: 08 May 2006
Posts: 8
Location: New York

PostPosted: Tue Jul 25, 2006 4:45 am    Post subject: Reply with quote

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_archive.tcl?mode=download&id=354
_________________
Aditya ( )==/

Channel: #TownHall @ DALnet
WebSite: http://www.aditya.coz.in
Back to top
View user's profile Send private message Visit poster's website
mvp1
Voice


Joined: 27 Jan 2022
Posts: 10

PostPosted: Sun May 08, 2022 7:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 770
Location: Tennessee, USA

PostPosted: Sun May 08, 2022 11:19 pm    Post subject: +v on "x" lines Reply with quote

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
View user's profile Send private message Visit poster's website
mvp1
Voice


Joined: 27 Jan 2022
Posts: 10

PostPosted: Mon May 09, 2022 12:19 am    Post subject: Re: +v on "x" lines Reply with quote

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
View user's profile Send private message
Spartan
Voice


Joined: 29 Apr 2022
Posts: 5

PostPosted: Wed May 11, 2022 4:52 am    Post subject: Hello Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 859

PostPosted: Mon May 23, 2022 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber