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 OP using X

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


Joined: 26 May 2012
Posts: 1

PostPosted: Sat May 26, 2012 6:13 am    Post subject: Mass OP using X Reply with quote

Hi is there anyone who can share their script with mass OP using through X of undernet? Thanks.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 24, 2013 8:29 am    Post subject: Reply with quote

!xop * = for opping everyone in the channel through X (everyone that doesnt have @ in the channel)
!xop = will @ you (if you dont have @)

Code:
bind pub - !xop pub:xop

proc pub:xop {nick uhost hand chan arg} {

   set who [lindex [split $arg] 0]

   if {$who == "*"} {
      foreach n [chanlist $chan] {
         if {![isop $n $chan]} {
            putserv "PRIVMSG X :op $chan $n"
         }
      }
   } else {
      if {![isop $nick $chan]} {
         putserv "PRIVMSG X :op $chan $nick"
      } else {
                        putserv "PRIVMSG $chan :You are already @"
                }
   }
}


Didnt test. If you encouter errors i will test it
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL


Last edited by Madalin on Thu Jan 24, 2013 2:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
caesar
Mint Rubber


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

PostPosted: Thu Jan 24, 2013 10:01 am    Post subject: Reply with quote

Here's a better version.

!xop with no arguments will tell X to op you if needed
!xop nick_1 nick_2 nick_3 and so on. will tell X to op the users that don't have op from the list you gave
!xop * - will tell X to op every user in the channel if doesn't have op
Code:

bind pub o !xop pub:xop

proc pub:xop {nick uhost hand chan text} {
   if {![onchan X $chan]} {
      puthelp "PRIVMSG $chan :I don't see X on this channel, do you?"
      return
   }
   if {![string length $text]} {
      if {![isop $nick $chan]} {
         puthelp "PRIVMSG X :op $chan $nick"
      } else {
         puthelp "PRIVMSG $chan :You already have op."
      }
   } else {
      if {[string equal -length 1 "*" [lindex [split $text] 0]]} {
         foreach user [chanlist $chan] {
            if {![isop $user $chan]} {
               lappend oplist $user
            }
         }
      } else {
         foreach user [split $text] {
            if {![isop $user $chan]} {
               lappend oplist $user
            }
         }
      }
      while {[llength $oplist] != 0} {
         puthelp "PRIVMSG $X :[join [lrange $oplist 0 14]]"
         set oplist [lrange $oplist 15 end]
      }
   }
}

Don't know how many nicks you can send to a line so adjust 15 to a proper limit. Haven't tested anything, just in my head. Reply back if you have any troubles with it.

Edit: Fixed. If you wish to have let's say 10 nicks per line change 14 with 9 and 15 with 10.
_________________
Once the game is over, the king and the pawn go back in the same box.


Last edited by caesar on Fri Jan 25, 2013 2:30 am; edited 1 time in total
Back to top
View user's profile Send private message
Get_A_Fix
Master


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

PostPosted: Thu Jan 24, 2013 10:08 am    Post subject: Reply with quote

Using services can tend to flood them, causing the bot to either be killed or even excess flood offline.
A better way would be using a script like this - a mass.tcl that you can configure.

Let us know if this helps.
_________________
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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
caesar
Mint Rubber


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

PostPosted: Thu Jan 24, 2013 3:11 pm    Post subject: Reply with quote

I guess you missed the part where I said 15 nicks per line. Razz
_________________
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
SpiKe^^
Owner


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

PostPosted: Thu Jan 24, 2013 3:41 pm    Post subject: Reply with quote

Though I would never recommend using chanserv for any kind of mass commands, thought I might clear up some minor issues in the above code...

caesar wrote:
Code:
      while {[llength $oplist] != 0} {
         puthelp "PRIVMSG $X :[join [lrange $oplist 0 15]]"
         set oplist [lrange $oplist 15 end]
      }


I would suggest something more like this...
Code:

      set howmany 15
      while {[llength $oplist] != 0} {
         puthelp "PRIVMSG X :op $chan [join [lrange $oplist 0 [expr {$howmany-1}]]]"
         set oplist [lrange $oplist $howmany end]
      }


_________________
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
caesar
Mint Rubber


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

PostPosted: Fri Jan 25, 2013 2:23 am    Post subject: Reply with quote

True, it starts the counting from 0 so it would be 16 nicks per line. But there's no need to add an expr just cos the user can't change from 15 to 14 or whatever count he wishes to have per line. But for lazy people that would do fine. Razz
_________________
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
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