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 

AOP with authcheck
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Mon May 19, 2008 7:59 am    Post subject: AOP with authcheck Reply with quote

Hi. after installing the following script i get this error

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


This is the Script


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

            }
         }
      }
   }
Back to top
View user's profile Send private message
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Mon May 19, 2008 8:10 am    Post subject: Re: AOP with authcheck Reply with quote

jonlar wrote:
Hi. after installing the following script i get this error

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


well, remove one } from the end
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon May 19, 2008 2:36 pm    Post subject: Reply with quote

Code:

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

In your procedure above, you treat set auth as if its a conditional if statement giving it a closing curly brace. Removing said brace and fixing the indenting should help you spot teh flaw.
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue May 20, 2008 2:54 am    Post subject: Reply with quote

This script will not work as intended because:
1) lists start with 0 (zero), not 1.
2) the numeric should be 352, not 354
3) only undernet uses the non-standard 354
Edit:
added #3, after a bit of research I found undernet uses this numeric
this script will not work on networks that use different IRCd types from undernet
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue May 20, 2008 4:09 am    Post subject: Reply with quote

give this script a try:
Code:
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)"
      }
   }
}

pproc raw354 {s r a} {
   global aop
   set a [split $a]
   set a2 [string tolower $a]
   regexp {.*? (.*?) .*? .*? .*? .*? .*? (.*?) .*?} [join a] -> rawid flags
   regexp {(.*?) .*? (.*?) (.*?) (.*?) (.*?) (.*?) .*? (.*?)} [join a2] -> bnick chan ident host nick auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
            }
         }
      }
   }
}
Back to top
View user's profile Send private message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Tue May 20, 2008 8:41 am    Post subject: Reply with quote

Cheers i will. I would like to change the script a bit

Got this but how to implement it in the authop script ?

Code:
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"
            }
         }
      }
   }


@Dragnlord: Get this while excecuting

Quote:

invalid command name "pproc"
while executing
"pproc raw354 {s r a} {
global aop
set a [split $a]
set a2 [string tolower $a]
regexp {.*? (.*?) .*? .*? .*? .*? .*? (.*?) .*?} [join a] ->..."


I want to use it on Quakenet
Back to top
View user's profile Send private message
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Tue May 20, 2008 8:51 am    Post subject: Reply with quote

just a typo, remove one "p" from
Code:
pproc raw354 {s r a} {

_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue May 20, 2008 11:26 am    Post subject: Reply with quote

Papillon wrote:
just a typo, remove one "p" from
Code:
pproc raw354 {s r a} {
I didn't notice that my keyboard has "stuttered", it should indeed be "proc" instead of "pproc".
Back to top
View user's profile Send private message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Wed May 21, 2008 7:30 am    Post subject: Reply with quote

Well its still not working. In partyline i get this

Tcl error [raw354]: can't read "rawid": no such variable
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Wed May 21, 2008 10:56 am    Post subject: Reply with quote

I spotted a few more typos (guess I shouldn't bother answering posts at 4am).
Code:

proc raw354 {s r a} {
   global aop
   set a [split $a]
   set a2 [string tolower $a]
   regexp {.*? (.*?) .*? .*? .*? .*? .*? (.*?) .*?} [join $a] -> rawid flags
   regexp {(.*?) .*? (.*?) (.*?) (.*?) (.*?) (.*?) .*? (.*?)} [join $a2] -> bnick chan ident host nick auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
            }
         }
      }
   }
}
Back to top
View user's profile Send private message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Thu May 22, 2008 7:41 am    Post subject: Reply with quote

hehe. well 4 a clock is early Wink

But its still nothing
Authed User joins the Chan and.... thats it.

Edit: well Partyline says:" Tcl error [raw354]: can't read "rawid": no such variable"

Here the whole Code

Code:
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 [split $a]
   set a2 [string tolower $a]
   regexp {.*? (.*?) .*? .*? .*? .*? .*? (.*?) .*?} [join $a] -> rawid flags
   regexp {(.*?) .*? (.*?) (.*?) (.*?) (.*?) (.*?) .*? (.*?)} [join $a2] -> bnick chan ident host nick auth
   set v "*+*"
   set o "*@*"
   if {[string equal -nocase $rawid $aop(rawid)]} {
      if {![string match $auth 0] > 0} {
         if {[channel get $chan aop]} {
            if {[string match "$o" "$flags"] == 0} {
               pushmode $chan +o $nick
       }
            }
         } else {
            pushmode $chan +v $nick
         }
      }
   }           
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu May 22, 2008 12:08 pm    Post subject: Reply with quote

Is the bot using a really old version of TCL?
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu May 22, 2008 1:03 pm    Post subject: Reply with quote

tested and working on undernet for me:
Code:

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 "UnderNet AOP script loaded"
Back to top
View user's profile Send private message
Fraud
Op


Joined: 19 May 2008
Posts: 101

PostPosted: Thu May 22, 2008 3:52 pm    Post subject: Reply with quote

Well i wrote i using it for Quakenet

Quote:
I want to use it on Quakenet
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Fri May 23, 2008 2:23 am    Post subject: Reply with quote

jonlar wrote:
Well i wrote i using it for Quakenet

Quote:
I want to use it on Quakenet
Unfortunately you did not say that in your initial post, the script had already been written by the time you did say that.
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 -> Scripting Help All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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