Now, im pretty lousy with regexp, but i tried to use this code so it pms the channel service with chanlev <channel> and it retrieves the things, now its not quite complete but the regexp i made doesnt seem to work
bind pub o|o \$chanlev pub:chanlevcheck
proc pub:chanlevcheck { nick host hand chan text } {
set ::chanlev(chan) "$chan"
bind notc - * notc:chanlev
putserv "PRIVMSG $chan :\002\273\002 Checking $chan's chanlev"
putserv "PRIVMSG [cserve $chan] :CHANLEV $chan"
}
proc notc:chanlev {nick host hand text [censored]} {
set chan $::chanlev(chan)
set from "$nick!$host"
if {[string match -nocase "Q!TheQBot@CServe.quakenet.org" $from]} {
if regex ^Total:\s([0-9]+)\s\(owner:\s([0-9]+),\smaster:\s([0-9]+),\sop:\s([0-9]+),\svoice:\s([0-9]+),\sban:\s([0-9]+)\)\.$}
# I have no clue how to use it :|
putserv "PRIVMSG $chan :\002\273\002 Unknown channel Blah!"
unbind notc - * notc:chanlev
return
}
proc cserve {chan} {
if {[onchan Q $chan]} {return "Q"} elseif {[onchan L $chan]} {return "L"} else {return ""}
}
Now again, i have no clue how to use it, so it looks like crap
I am not that good myself with regular expressions, but you are not using the correct syntax of regexp even. You forgot to mention the variable to match with even, so I will assume it to be $text.
As for that tcl error escape the [0-9] square brackets. That is what the error is about. As for the matching bit, I am not sure because I don't have the output which you are trying to match.