| View previous topic :: View next topic |
| Author |
Message |
Fraud Op
Joined: 19 May 2008 Posts: 101
|
Posted: Mon May 19, 2008 7:59 am Post subject: AOP with authcheck |
|
|
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 |
|
 |
dwickie Halfop
Joined: 21 Aug 2004 Posts: 76 Location: /pub/beer
|
Posted: Mon May 19, 2008 8:10 am Post subject: Re: AOP with authcheck |
|
|
| 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 |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon May 19, 2008 2:36 pm Post subject: |
|
|
| 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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue May 20, 2008 2:54 am Post subject: |
|
|
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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue May 20, 2008 4:09 am Post subject: |
|
|
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 |
|
 |
Fraud Op
Joined: 19 May 2008 Posts: 101
|
Posted: Tue May 20, 2008 8:41 am Post subject: |
|
|
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 |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Tue May 20, 2008 8:51 am Post subject: |
|
|
just a typo, remove one "p" from | Code: | | pproc raw354 {s r a} { |
_________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue May 20, 2008 11:26 am Post subject: |
|
|
| 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 |
|
 |
Fraud Op
Joined: 19 May 2008 Posts: 101
|
Posted: Wed May 21, 2008 7:30 am Post subject: |
|
|
Well its still not working. In partyline i get this
Tcl error [raw354]: can't read "rawid": no such variable |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed May 21, 2008 10:56 am Post subject: |
|
|
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 |
|
 |
Fraud Op
Joined: 19 May 2008 Posts: 101
|
Posted: Thu May 22, 2008 7:41 am Post subject: |
|
|
hehe. well 4 a clock is early
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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu May 22, 2008 12:08 pm Post subject: |
|
|
| Is the bot using a really old version of TCL? |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu May 22, 2008 1:03 pm Post subject: |
|
|
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 |
|
 |
Fraud Op
Joined: 19 May 2008 Posts: 101
|
Posted: Thu May 22, 2008 3:52 pm Post subject: |
|
|
Well i wrote i using it for Quakenet
| Quote: | | I want to use it on Quakenet |
|
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Fri May 23, 2008 2:23 am Post subject: |
|
|
| 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 |
|
 |
|