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.

Mass voice

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

could this tcl be modified to mass voice/unvoice all regular nonvoiced/voiced users in the channel with 15 users per line with a pub cmd


i found this tcl



and was wondering if voice modes can be compressed to the max allowed in ircd with is in this case 15 unlike the default 4 with pushmode
i wanne use this on a network with up to 400+ users per channel


(+simo) : !mv
&Eggy Sets Mode on #Cappuccino to: +vvvv Alhoceima safouane Nador StarNet
&Eggy Sets Mode on #Cappuccino to: +vvvv simoo mourad Target Ouafa
-Eggy- : Voiced all users on #Cappuccino. (RifSytes)
&Eggy Sets Mode on #Cappuccino to: +vvv SonnyBonds imad Puto

what i look for is :
&Eggy Sets Mode on #Cappuccino to: +vvvvvvvvvvv SonnyBonds imad Puto simoo mourad Target Alhoceima safouane Nador StarNet Ouafa


Code: Select all

bind pub m|m !mv voice_all
proc voice_all {nick host handle chan args} {
 if {![botisop $chan]} {
puthelp "NOTICE $nick :I'm not oped on $chan."
   return 1
  }
 foreach user [chanlist $chan] {
   if {![isvoice $user $chan]} {
   pushmode $chan +v $user 
    }
 }
 puthelp "NOTICE $nick :Voiced all users on $chan."
}



putlog "Loaded massvoice.tcl" 
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Give this a try and let me know if isn't working.

Code: Select all

bind pub m|m !mv voice_all

proc voice_all {nick host handle chan text} {
	if {![botisop $chan]} {
		puthelp "NOTICE $nick :I'm not oped on $chan."
		return
	}
	
	# grab the channel members list and exclude the bot from it
	set userList [chanlist $chan]
	set pos [lsearch -nocase $userList $::botnick]
	set userList [lreplace $userList $pos $pos] 
	
	# build the voice list with only people that aren't voiced
	foreach user [split $userList] {
		if {![isvoice $user $chan]} {
			lappend voiceList $user
		}
    }
	
	# define the max amount of modes per line
	set max 15
	
	# voice all the members in the above built voice list
	if {[info exists voiceList]} {
		set len [llength $voiceList]
		while {$len > 0} {
			if {$len > $max} {
			set mode [string repeat "v" $max]
			set users [join [lrange $voiceList 0 [expr {$max - 1}]]]
			set voiceList [lrange $voiceList $max end]
			incr len -$max
			} else {
				set mode [string repeat "v" $len]
				set users [join $voiceList]
				set len 0
			}
			puthelp "MODE $chan +$mode $users"
		}
		puthelp "NOTICE $nick :Voiced all users on $chan."
	} else {
		puthelp "NOTICE $nick :Nobody needed to be voiced on $chan."
	}
}

putlog "Loaded massvoice.tcl"
Would appreciate if you would open a new topic and link to an older one rather than reviving the old one.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

excellent works great thnx caesar
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

could only regular user be voiced and leave everyone with acces like owner/admin/OP/HalfOP since they can voice themselves
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Sure, will use nick2hand to get the handle (or user name) for each user and then check if that is valid with validuser and skip it.

So, before the:

Code: Select all

if {![isvoice $user $chan]} {
line add:

Code: Select all

set hand [nick2hand $user $chan]
if {[validuser $hand]} continue
The foreach loop now becomes:

Code: Select all

foreach user [split $userList] {
	set hand [nick2hand $user $chan]
	if {[validuser $hand]} continue
	if {![isvoice $user $chan]} {
		lappend voiceList $user
	}
}
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thx ceasar
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Simo, for 1.6.21 there is support for isop, ishalfop, and isvoice, but I think what you're talking about are isadmin and isowner. These are currently not supported and require a small script that was released by Thommey, which can be found here and is called Arbitrary chanmodes (+q, +a)

Once you have this script loaded, you can add the isowner/isadmin calls to any script you're running, to match the ~ and & user's.
Last edited by Get_A_Fix on Wed May 25, 2016 7:57 pm, edited 1 time in total.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, I think I misunderstood what you wanted.

Get_A_Fix is right, meaning you would need that script to extend the two commands and do the channel monitoring to maintain a list of owner and admin, cos the other two, the op (isop) and halfop (ishalfop), are already built-in the eggdrop.

What I suggested is based on the access to the bot, not of the server the bot is on.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thnx ceasar and get_a_fix and infact i have thommeys script loaded for isadmin and isowner thnx guys i think i got it working now

apreciated as always
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i had just one request , when it executes to also set these modes only ones and set timer to removes modes ones as well so in the case of ppl doin !mv all the time it wont set like 10 timers for the same fuction to add/remove the mode settings

Code: Select all

 putquick "MODE $chan +wwwwwww v:G:PK v:G:IN v:G:AE v:G:BH v:G:SA"  -next
 timer 30  [list  putquick "MODE $chan -wwwwwww v:G:PK v:G:IN v:G:AE v:G:BH v:G:SA"  -next]
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Honestly I don't understand what you are asking about.
Once the game is over, the king and the pawn go back in the same box.
Post Reply