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.
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
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
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] ->..."
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"