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 

Mass voice

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Fri May 20, 2016 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Sat May 21, 2016 6:12 am    Post subject: Reply with quote

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.
_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Sat May 21, 2016 12:42 pm    Post subject: Reply with quote

excellent works great thnx caesar
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Sun May 22, 2016 1:28 pm    Post subject: Reply with quote

could only regular user be voiced and leave everyone with acces like owner/admin/OP/HalfOP since they can voice themselves
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Mon May 23, 2016 10:29 am    Post subject: Reply with quote

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
   }
}

_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Mon May 23, 2016 3:11 pm    Post subject: Reply with quote

thx ceasar
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Mon May 23, 2016 8:31 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Tue May 24, 2016 4:26 am    Post subject: Reply with quote

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.
_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Wed May 25, 2016 6:41 am    Post subject: Reply with quote

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


Joined: 22 Mar 2015
Posts: 204

PostPosted: Sun May 29, 2016 10:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Mon May 30, 2016 1:07 am    Post subject: Reply with quote

Honestly I don't understand what you are asking about.
_________________
You may say anything about me, but don't misspell my name.
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
Page 1 of 1

 
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