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 

OperIt and auto op for IRCop

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


Joined: 08 Aug 2011
Posts: 12

PostPosted: Wed Mar 01, 2023 1:39 pm    Post subject: OperIt and auto op for IRCop Reply with quote

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?
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Mar 02, 2023 11:03 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
raven
Voice


Joined: 08 Aug 2011
Posts: 12

PostPosted: Thu Mar 02, 2023 1:40 pm    Post subject: Reply with quote

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 Smile (We run ratbox btw)
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Mar 02, 2023 4:01 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
raven
Voice


Joined: 08 Aug 2011
Posts: 12

PostPosted: Sat Mar 04, 2023 6:31 am    Post subject: Reply with quote

I know very little to nothing about scripting. irssi has a script for it, so it "should" be doable using /whois or RAW?
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Sat Mar 04, 2023 9:40 am    Post subject: Reply with quote

Give a link to the irssi script so we can understand exactly your expectations.
_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
raven
Voice


Joined: 08 Aug 2011
Posts: 12

PostPosted: Sat Mar 04, 2023 10:36 am    Post subject: Reply with quote

https://scripts.irssi.org/scripts/operit.pl

and on github:

https://github.com/irssi/scripts/blob/master/scripts/operit.pl
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Mar 04, 2023 11:21 am    Post subject: Reply with quote

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:

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

Back to top
View user's profile Send private message
raven
Voice


Joined: 08 Aug 2011
Posts: 12

PostPosted: Sat Mar 04, 2023 11:35 am    Post subject: Reply with quote

Nope, that did nothing. I am Server Admin, if that makes a difference? Different RAW numerical?
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Mar 04, 2023 11:40 am    Post subject: Reply with quote

perhaps i could connect to your server and do some checks myselve if you are ok with that if so pm me the details
Back to top
View user's profile Send private message
raven
Voice


Joined: 08 Aug 2011
Posts: 12

PostPosted: Sat Mar 04, 2023 11:43 am    Post subject: Reply with quote

Sure, we can be found on irc.sosdg.org
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Mar 04, 2023 12:04 pm    Post subject: Reply with quote

edit basic working code :

Code:



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

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