| View previous topic :: View next topic |
| Author |
Message |
juan Voice
Joined: 26 May 2012 Posts: 1
|
Posted: Sat May 26, 2012 6:13 am Post subject: Mass OP using X |
|
|
| Hi is there anyone who can share their script with mass OP using through X of undernet? Thanks. |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Thu Jan 24, 2013 8:29 am Post subject: |
|
|
!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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Jan 24, 2013 10:01 am Post subject: |
|
|
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 |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Thu Jan 24, 2013 10:08 am Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Jan 24, 2013 3:11 pm Post subject: |
|
|
I guess you missed the part where I said 15 nicks per line.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Thu Jan 24, 2013 3:41 pm Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jan 25, 2013 2:23 am Post subject: |
|
|
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.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|