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.

AOP with authcheck

Help for those learning Tcl or writing their own scripts.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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 a [join [split $a]]
   regexp {(.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?)} $a match bnick rawid chan ident host nick flags auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop] || [channel get [string tolower $chan] aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
            }
         }   
      }     
   }         
}           
putlog "ircu AOP script loaded"
Happier now?
By the way, quakenet uses undernet's ircd (just in case you didn't know that).
F
Fraud
Op
Posts: 101
Joined: Mon May 19, 2008 7:57 am

Post by Fraud »

ahh Ok. no did not knew that. Thank u very much for ure help.

Well hope u will not kill me but is it possible to implement this part ?

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"
            }
         }
      }
   }
Maybe to let the user edit the trigger like
set op(trigger) "\."
Thank u
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

of course that's possible :)
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Code: Select all

setudef flag aop

set aop(channel) "#channel"
set aop(rawid) "678"
set aop(cmd) "!aop"

bind time -|- "* * * * *" scantime
bind PUB o $aop(cmd) aop_pub

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 a [join [split $a]]
   regexp {(.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?)} $a match bnick rawid chan ident host nick flags auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop] || [channel get [string tolower $chan] aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
            }
         }   
      }     
   }         
}

proc aop_pub {n u h c t} {
   set s [lindex $t 0]
   switch $s {
      on {
         if {[channel get $c aop]} {
            putserv "NOTICE $n :Auto op is already \002on\002 for $c"
         } else {
            channel set $c +aop
            putserv "NOTICE $n :Auto op is now \002on\002 for $c"
         }
      }
      off {channel set $c -aop; putserv "NOTICE $n :Auto op is now \002off\002 for $c"}
      default {
         if {[channel get $c aop]} {
            putserv "NOTICE $n :Auto op is \002on\002 for $c"
         } else {
            putserv "NOTICE $n :Auto op is \002off\002 for $c"
         }
      }
   }
}
putlog "ircu AOP script loaded"
F
Fraud
Op
Posts: 101
Joined: Mon May 19, 2008 7:57 am

Post by Fraud »

Well i meant !aop #channel on/off status

that somebody can enter in chan !aop #xyz on

and it ops also Users that have +d Flag on q. Means the Bot ops and q deops and this the whole time.

i´ve tried this
if {[matchattr [nick2hand $nick] d|d $chan] == 0} {
but its not working
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

jonlar wrote:Well i meant !aop #channel on/off status

that somebody can enter in chan !aop #xyz on

and it ops also Users that have +d Flag on q. Means the Bot ops and q deops and this the whole time.

i´ve tried this
if {[matchattr [nick2hand $nick] d|d $chan] == 0} {
but its not working
Is "q" your bot? If you are talking about the quakenet services, then you'll have to set that user +d on your bot also.
F
Fraud
Op
Posts: 101
Joined: Mon May 19, 2008 7:57 am

Post by Fraud »

Yep its q net. Sorry.

Well if i dont want to set +d on my bot, just checking on Q it has to be look like
if {[matchattr [nick2hand $nick] +d $chan] == 0} {
??

and what i meant with the trigger is...

Code: Select all

setudef flag aop
bind pub n "!aop" pub:aop
bind join - * join:aop
Well i dont know how o bind the rest in the code. maybe

Code: Select all

setudef flag aop
bind pub n "!aop" pub:aop
bind join - * join:aop


bind time -|- "* * * * *" scantime
bind PUB o $aop(cmd) aop_pub

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 a [join [split $a]]
   regexp {(.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?)} $a match bnick rawid chan ident host nick flags auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop] || [channel get [string tolower $chan] aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
            }
         }   
      }     
   }         
}

proc aop_pub {n u h c t} {
   set s [lindex $t 0]
   switch $s {
      on {
         if {[channel get $c aop]} {
            putserv "NOTICE $n :Auto op is already \002on\002 for $c"
         } else {
            channel set $c +aop
            putserv "NOTICE $n :Auto op is now \002on\002 for $c"
         }
      }
      off {channel set $c -aop; putserv "NOTICE $n :Auto op is now \002off\002 for $c"}
      default {
         if {[channel get $c aop]} {
            putserv "NOTICE $n :Auto op is \002on\002 for $c"
         } else {
            putserv "NOTICE $n :Auto op is \002off\002 for $c"
         }
      }
   }
}
putlog "ircu AOP script loaded"
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

matchattr is only for internal eggdrop flag checking.

it has NOTHING to do with Q.
Instead you should be smart enough to just not op all users on your channel.
F
Fraud
Op
Posts: 101
Joined: Mon May 19, 2008 7:57 am

Post by Fraud »

Well smart or not. thats why i want the script for the "smartness"
Post Reply