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.

OperIt and auto op for IRCop

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

OperIt and auto op for IRCop

Post by raven »

Hi. I Co-admin a smaller network, and would like a script that auto-ops any IRCop that joins, and that ops on trigger "operit". Anyone around that can help me out?
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

you can use oper / superadmin option for that if you are using anope services on your IRC network or in the case u use inspircd there is a module you could use for that
r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

Post by raven »

simo wrote:you can use oper / superadmin option for that if you are using anope services on your IRC network or in the case u use inspircd there is a module you could use for that
Perhaps, but I still want that as a script if possible :) (We run ratbox btw)
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

how would eggdrop know who is an ircop and who isnt ?

if there is a way to find out you could use that in a tcl to retreive
r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

Post by raven »

I know very little to nothing about scripting. irssi has a script for it, so it "should" be doable using /whois or RAW?
User avatar
CrazyCat
Revered One
Posts: 1217
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Give a link to the irssi script so we can understand exactly your expectations.
r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

Post by raven »

s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

from what i have read and checking raw numerics for ircoper i came to find its raw numeric 313 that retreives ircops status in a whois

i came up with this see if it works as i dont run ratbox myselve else i could have tested myselve but from what ive read raw numeric 313 is RFC1459





see if this works out for you

Code: Select all

bind raw - 313 check:isircop
bind join - * join:checkisircop
 
 
proc join:checkisircop {nick uhost hand chan} {
  if {[botisop $chan] && ![isbotnick $nick] && ![validuser [nick2hand $nick]]} {
    putserv "WHOIS $nick"
  }
}

proc check:isircop {from keyword args} {
  global verifieduser
  if {![string match $verifieduser $args]} {return}
  set nick [lindex [split $args] 1]

  if {[validuser [nick2hand $nick]]} return
  foreach chan [channels] {
    if {![onchan $nick $chan] || [isop $nick $chan] || [isvoice $nick $chan]} continue
   if {[botisop $chan]} { pushmode $chan +v $nick }
  }
 }

r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

Post by raven »

Nope, that did nothing. I am Server Admin, if that makes a difference? Different RAW numerical?
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

perhaps i could connect to your server and do some checks myselve if you are ok with that if so pm me the details
r
raven
Voice
Posts: 12
Joined: Mon Aug 08, 2011 9:06 am

Post by raven »

Sure, we can be found on irc.sosdg.org
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

edit basic working code :

Code: Select all



bind raw - 313 check:isircop
bind join - * join:checkisircop
 
 


bind pub - operit check:ircop

proc check:ircop {nick uhost hand chan text} {
     set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  if {[botisop $chan] && ![isbotnick $nick]} {
    putserv "WHOIS $nick"
  }
}


proc join:checkisircop {nick uhost hand chan} {
  if {[botisop $chan] && ![isbotnick $nick]} {
    putserv "WHOIS $nick"
  }
}

proc check:isircop {from keyword args} {
  set nick [lindex [split $args] 1]

  foreach chan [channels] {
    if {![onchan $nick $chan] || ![botisop $chan] || [isop $nick $chan]} continue
   pushmode $chan +o $nick 
  }
 }
  

Post Reply