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.

first 6 stacked nicks in this mass voice tcl

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

first 6 stacked nicks in this mass voice tcl

Post by simo »

greetings folks,

i was trying to get this mass voice tcl (with delay) to voice first stacked nicks of 6 (or less if there are less then 6 to voice) instant and the rest with delay, but i couldnt figure a way to achieve this perhaps someone of you knows a of a proper method to achieve this.

Thanks i advance,

Code: Select all



bind pub -|- .mv voice_all
bind pub -|- !mv voice_all

proc voice_all {nick host hand chan text} {
	if {![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr $hand o|o $chan]} { return 0 }

	set userList [chanlist $chan]
	set pos [lsearch -nocase $userList $::botnick]
	set userList [lreplace $userList $pos $pos]



	foreach user  $userList {
		if {![isvoice $user $chan] && ![isop $user $chan] && ![ishalfop $user $chan] && ![matchattr [nick2hand $user] of|of $chan]} {  lappend voiceList $user }
	}


	# define the max amount of modes per line
	set max 6

	# op all the members in the above built voice list
	if {[info exists voiceList]} {
		set voiceList [lsort -unique $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
			}
			incr counter 1
			after [expr {$counter*4000}] [list  putnow "MODE $chan +$mode $users"]
		}
		puthelp "NOTICE $nick :Voiced all users on $chan."
	} else {
		puthelp "NOTICE $nick :Nobody needed to be Voiced on $chan."
	}
}


D
DasBrain
Voice
Posts: 19
Joined: Thu Apr 08, 2021 12:31 pm

Re: first 6 stacked nicks in this mass voice tcl

Post by DasBrain »

Did you consider using pushmode?
Online
s
simo
Revered One
Posts: 1090
Joined: Sun Mar 22, 2015 2:41 pm

Re: first 6 stacked nicks in this mass voice tcl

Post by simo »

pushmode doesnt allow custom delay wich is what im after as delay i want to use differs from network to network as well as stacked modes per line.
Online
s
simo
Revered One
Posts: 1090
Joined: Sun Mar 22, 2015 2:41 pm

Re: first 6 stacked nicks in this mass voice tcl

Post by simo »

i think i found a way to achieve that and it seems to work as expected thanks DasBrain for helping trying to find solutions wich is always apreciated as always.

thanks Dasbrain.
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: first 6 stacked nicks in this mass voice tcl

Post by CrazyCat »

simo wrote: Mon May 13, 2024 9:47 am pushmode doesnt allow custom delay wich is what im after as delay i want to use differs from network to network as well as stacked modes per line.
The number of stacked modes allowed by the server is usually sent by the server itself (and I think eggdrop use it).
Concerning the delay... Why do you want to use another one than the eggdrop's one ?
Post Reply