| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri May 20, 2016 1:12 pm Post subject: |
|
|
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: |
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" |
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat May 21, 2016 6:12 am Post subject: |
|
|
Give this a try and let me know if isn't working.
| Code: |
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat May 21, 2016 12:42 pm Post subject: |
|
|
| excellent works great thnx caesar |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sun May 22, 2016 1:28 pm Post subject: |
|
|
| could only regular user be voiced and leave everyone with acces like owner/admin/OP/HalfOP since they can voice themselves |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 23, 2016 10:29 am Post subject: |
|
|
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: |
if {![isvoice $user $chan]} {
|
line add:
| Code: |
set hand [nick2hand $user $chan]
if {[validuser $hand]} continue
|
The foreach loop now becomes:
| Code: |
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 23, 2016 3:11 pm Post subject: |
|
|
| thx ceasar |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Mon May 23, 2016 8:31 pm Post subject: |
|
|
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. _________________ 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.
Last edited by Get_A_Fix on Wed May 25, 2016 7:57 pm; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue May 24, 2016 4:26 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Wed May 25, 2016 6:41 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sun May 29, 2016 10:16 pm Post subject: |
|
|
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: | 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]
|
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 30, 2016 1:07 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|