OP if authed

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

OP if authed

Postby jonlar » Sat May 10, 2008 11:51 am

Hi everybody. The first request in here.

Well. i am looking for an autoop script that use a little bit secure.
Before somebody gets op in my chan it shall be checked if this user is Q authed and maybe also using an Ident. I just want to make shure that nobody with a Proxy or different gets op.

Thanks for the Help.
jonlar
jonlar
 

Re: OP if authed

Postby Cristian » Sat May 17, 2008 10:51 am

Hi
This script ops people who is authed by Q.
I made this work for one channel, which should be edited in the aop(channel).
Remember to .chanset #channel +aop


Code: Select all
   setudef flag aop

   set aop(channel) "#channel"
   set aop(rawid) "678"
   bind time -|- "* * * * *" scantime

   proc scantime {minute hour day month year} {
      global aop
      bind RAW -|- {354} raw354
      if {[validchan $aop(channel)]} {
         if {[channel get $aop(channel) aop]} {
            putserv "WHO $aop(channel) n%cnahuft,$aop(rawid)"
         }
      }
   }

   proc raw354 {s r a} {
      global aop
      set rawid "[lindex [split $a] 1]"
      set chan "[string tolower [lindex [split $a] 2]]"
      set ident "[string tolower [lindex [split $a] 3]]"
      set host "[string tolower [lindex [split $a] 4]]"
      set nick "[string tolower [lindex [split $a] 5]]"
      set flags "[lindex [split $a] 6]"

      set v "*+*"
      set o "*@*"
      if {[string equal -nocase $rawid $aop(rawid)]} {
         if {![string match [lindex [split $a] 7] 0] > 0} {
            set auth "[string tolower [lindex [split $a] 7]]"
            if {[channel get $chan aop] == 1} {
               if {[string match "$o" "$flags"] == 0} {
                  pushmode $chan +o $nick
               }
            }
         }
      }
   }
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: OP if authed

Postby jonlar » Mon May 19, 2008 11:45 am

Thx a lot.

well a mistake

after restart i get this in partyline

invalid command name "}"
while executing
"}"
invoked from within


Edit: well to Stupid ;) got it

on more question. Is it possible to add triggers? like !aop #channel on/off
jonlar
 

Re: OP if authed

Postby Cristian » Mon May 19, 2008 6:43 pm

its possible, add this code to the script and rehash your eggdrop.

Commands: !aop - !aop on - !aop off

The o in this line is the userflag that is required to trigger this command (bind PUB o !aop aop_pub)
You can read more about that here Eggdrop Tcl Commands or in ./doc/tcl-commands.doc.

Code: Select all
   bind PUB o !aop aop_pub

   proc aop_pub {nick uhost hand chan arg} {
      set s [lindex $arg 0]
      switch $s {
         on {
            if {[channel get $chan aop]} {
               putserv "NOTICE $nick :Auto op is already \002on\002 for $chan"
            } else {
               channel set $chan +aop
               putserv "NOTICE $nick :Auto op is now \002on\002 for $chan"
            }
         }
         off { channel set $chan -aop; putserv "NOTICE $nick :Auto op is now \002off\002 for $chan" }

         default {
            if {[channel get $chan aop]} {
               putserv "NOTICE $nick :Auto op is \002on\002 for $chan"
            } else {
               putserv "NOTICE $nick :Auto op is \002off\002 for $chan"
            }
         }
      }
   }
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: OP if authed

Postby jonlar » Tue May 20, 2008 11:34 am

Cheers might. I am sorry to beggar again but is there any possibility vor a voice mode too ? For all the others who are not authed?! Thank you a lot for your Help
jonlar
 

Re: OP if authed

Postby Cristian » Tue May 20, 2008 4:08 pm

Then you have to edit:
Code: Select all
   proc raw354 {s r a} {
      global aop
      set rawid "[lindex [split $a] 1]"
      set chan "[string tolower [lindex [split $a] 2]]"
      set ident "[string tolower [lindex [split $a] 3]]"
      set host "[string tolower [lindex [split $a] 4]]"
      set nick "[string tolower [lindex [split $a] 5]]"
      set flags "[lindex [split $a] 6]"

      set v "*+*"
      set o "*@*"
      if {[string equal -nocase $rawid $aop(rawid)]} {
         if {![string match [lindex [split $a] 7] 0] > 0} {
            set auth "[string tolower [lindex [split $a] 7]]"
            if {[channel get $chan aop] == 1} {
               if {[string match "$o" "$flags"] == 0} {
                  pushmode $chan +o $nick
               }
            }
         }
      }
   }



To:
Code: Select all
   proc raw354 {s r a} {
      global aop
      set rawid "[lindex [split $a] 1]"
      set chan "[string tolower [lindex [split $a] 2]]"
      set ident "[string tolower [lindex [split $a] 3]]"
      set host "[string tolower [lindex [split $a] 4]]"
      set nick "[string tolower [lindex [split $a] 5]]"
      set flags "[lindex [split $a] 6]"

      set v "*+*"
      set o "*@*"
      if {[string equal -nocase $rawid $aop(rawid)]} {
         if {![string match [lindex [split $a] 7] 0] > 0} {
            set auth "[string tolower [lindex [split $a] 7]]"
            if {[channel get $chan aop] == 1} {
               if {[string match "$o" "$flags"] == 0} {
                  pushmode $chan +o $nick
               }
            }
         } else {
            pushmode $chan +v $nick
         }
      }
   }


What you do is putting in:
Code: Select all
else {
      pushmode $chan +v $nick
   }


Which gives voice to users that isn't authed:
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: OP if authed

Postby jonlar » Wed May 21, 2008 7:24 pm

Well everybody gets +v now
jonlar
 

Re: OP if authed

Postby Cristian » Thu May 22, 2008 2:49 pm

hmm, I will take a look, and post a fix, later.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: OP if authed

Postby Cristian » Thu May 22, 2008 6:37 pm

I have released the script here I hope this filled out your request.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: OP if authed

Postby jonlar » Fri May 23, 2008 2:59 pm

Sumsar wrote:I have released the script here I hope this filled out your request.



Cheers Might. Very kind of u

Well, one Prob. after i start the Trigger "!aop on" everybody with auth gets op (OK) but people with +d (deop) on Q will opped the whole time by the bot and deopped by q...... also if i deop ppl the bot ops them again.

Maybe like this way.
Starting the Trigger !aop on - chan will be scanned - all authed gets op, then stop and just new joined ppl will be scanned ??? somethink like this

Well also non authed gets op.
jonlar
 

Next

Return to TCL Scripting Request

Who is online

Users browsing this forum: No registered users and 0 guests

cron