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.

Re: OP if authed

Postby Cristian » Fri May 23, 2008 4:01 pm

If you add, this code to the script:

Code: Select all
if {[matchattr [nick2hand $nick] d|d $chan] == 0} {


Then you get:

Code: Select all
setudef flag aop

namespace eval aop {

   namespace eval variable {
      variable rawid 678
   }
   bind time -|- "* * * * *" [namespace current]::scantime

   proc scantime {minute hour day month year} {
      bind RAW -|- {354} [namespace current]::raw354
      foreach channel [channels] {
         if {[channel get $channel aop]} {
            if {[botisop $channel]} {
               putserv "WHO $channel n%cnahuft,$::aop::variable::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::variable::rawid]} {
         if {[botisop $chan]} {
            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} {
                     if {[matchattr [nick2hand $nick] d|d $chan] == 0} {
                        pushmode $chan +o $nick
                     }
                  }
               }
            } else {
               pushmode $chan +v $nick
            }
         }
      }
   }

   bind PUB o !aop [namespace current]::public

   proc public {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"
            }
         }
      }
   }
}


A little info, I'm working on a update.
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 5:24 pm

Well. Nice. What else can i say :)
jonlar
 

Re: OP if authed

Postby jonlar » Fri May 23, 2008 6:08 pm

Well lil Prob when i want to join the 2nd Site

http://sp00fed.dk/forum/op-if-authed-t82s10.php
No input file specified.


I am using FireFox 2
jonlar
 

Re: OP if authed

Postby Lukemob » Sat May 24, 2008 11:28 am

Well, I think it's useless to use RAWs here. Just op the users who are already authed in the chan yourself, then use the script for newly-joining users.

I have just written it, not tried... if you find any bug there, please report it here.

Code: Select all
setudef flag authop

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

proc pub:aop {nick host hand chan arg} {
   if {[lindex $arg 0] == ""} {
      putserv "notice $nick :Usage: !aop on|off|status"
   } else {
      if {[lindex $arg 0] == "status"} {
         if {[channel get $chan authop] == "1"} {
          putserv "notice $nick :Auto op status is enabled."
       } else {
          putserv "notice $nick :Auto op status is disabled."
       }
      } elseif {[lindex $arg 0] == "on"} {
         if {[channel get $chan authop] != "1"} {
            channel set $chan +authop
            putserv "notice $nick :Auto op status has been enabled."
         } else {
            putserv "notice $nick :Autop op status is already enabled."
         }
      } elseif {[lindex $arg 0] == "off"} {
         if {[channel get $chan authop] != "0"} {
            channel set $chan -authop
            putserv "notice $nick :Autop op status has been disabled."
         } else {
            putserv "notice $nick :Auto op status is already disabled."
         }
      }
   }
}
proc join:aop {nick host hand chan} {
   if {[string match *.users.quakenet.org* $host]} {
      if {[channel get $chan authop] == "1"} {
         putserv "mode $chan +o $nick"
      }
   }
}


Thx
Last edited by Lukemob on Sat May 24, 2008 6:10 pm, edited 1 time in total.
Lukemob
 

Re: OP if authed

Postby jonlar » Sat May 24, 2008 2:05 pm

why authing them myself? i am not online 24/7. Thats why i have an Eggdrop. Well i´ll try it and wait for the update from Sumsar. Thx

btw. this script seems just to be checking the host. Not if a User is really authed. Sometime ppl are authed but not setted +xi mode on Q
jonlar
 

Re: OP if authed

Postby Lukemob » Sat May 24, 2008 6:10 pm

Well, if you read THIS TOPIC, exactlier "What it does" line, you would get it's for mode +x users. Anyway the script's fixed.

tHx
Lukemob
 

Re: OP if authed

Postby jonlar » Sun May 25, 2008 4:57 pm

Well nice allt all but i´ll wait for Sumsar update
jonlar
 

Re: OP if authed

Postby Lukemob » Tue May 27, 2008 4:22 pm

Ok, sure, no problem. Maybe you would also want to check THIS
Lukemob
 

Previous

Return to TCL Scripting Request

Who is online

Users browsing this forum: No registered users and 1 guest

cron