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

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
juan
Voice
Posts: 1
Joined: Sat May 26, 2012 5:52 am

Mass OP using X

Post by juan »

Hi is there anyone who can share their script with mass OP using through X of undernet? Thanks.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

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

Code: Select all

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
Last edited by Madalin on Thu Jan 24, 2013 2:10 pm, edited 1 time in total.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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: Select all

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.
Last edited by caesar on Fri Jan 25, 2013 2:30 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I guess you missed the part where I said 15 nicks per line. :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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: Select all

      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: Select all

      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
.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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. :P
Once the game is over, the king and the pawn go back in the same box.
Post Reply