This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Chanpro2.2.tcl Regexp Error

Old posts that have not been replied to for several years.
Locked
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Chanpro2.2.tcl Regexp Error

Post by blood_x »

Hi there,

I'm using no.spam1.7.2.tcl for my eggdrop. But sometime msg as below appears;

Tcl error [check_pubm]: couldn't compile regular expression pattern: brackets [] not balanced

How to fix it up?

Thanks.

p/s: No.spam1.7.2 written by ppslim can be found here.
Last edited by blood_x on Mon May 10, 2004 9:30 am, edited 2 times in total.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It's not my script causing that.

My scripts consists of only two regular expressions, both of which are all 100% valid.

Beyond that, there is no procedure called check_pubm. Which sugests another script you have loaded.
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Opss, I'm so sorry for it, ppslim. Argh, mistake done! WooPs, I've changed the topic k :wink: . After review one by one TCL scripts that I have loaded, I found that "Chanpro2.2.tcl" make the regexp error as stated before.

Here is check_pubm proc;

proc check_pubm {nick host hand chan text} {

#load some global variables
global chanpro botnick

#set some variables
set botnicky [string tolower $botnick]
set chan [string tolower $chan]
set enabled [lsearch -exact $chanpro(chans) $chan]
set host [string tolower $host]

#check if the chan enabled, else return..
if {!$chanpro(all) && $enabled == -1} {return 0}

#check if the bot is OPed, else return..
if {![botisop $chan]} {return 0}

#check if the bot is actually typing the word himself, if so - return..
if {[string tolower $nick] == $botnicky} {return 0}

#check if other bot is actually typing the word <- Added to fix bugs
if {[matchattr $hand +b]} {return 0}

#check the text for colors, bold, underline and CAPS
if {[string match *\003* $text]} {check_color $nick $host $hand $chan $text} \
elseif {[string match *\002* $text]} {check_bold $nick $host $hand $chan $text} \
elseif {[string match *\037* $text]} {check_underline $nick $host $hand $chan $text} \
else {check_caps $nick $host $hand $chan $text}

} ;#end proc

And how to fix it up?
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Pasting the regexp would help...
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

I found one match for "regexp" as below;

6 {
if {[regexp ^(\[0-9.\])+$ [set parsed [lindex [split $host @] 1]]]} {
set parsed *!*[lindex [split $host @] 0]@[join [lrange [split $parsed .] 0 1] .].*
} elseif {[string match -nocase *.users.undernet.org* $host]} {
set parsed *!*@[lindex [split $host @] 1]
} else {
set first [split $host @]
set second [split [lindex $first 1] .]
set parsed *!*[lindex $first 0]@*.[lindex $second end-1].[lindex $second end]
}
}
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

#check if the bot is actually typing the word himself, if so - return..
if {[string tolower $nick] == $botnicky} {return 0}
Noticed a typo in check_pubm, "$botnicky". Change to "$botnick".

(A little off the track)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Opss, but it is some variables (as in the script)

set botnicky [string tolower $botnick]

Still typo faulty? :mrgreen:
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Woops? lol :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

WooOOops! Still no answer.. on how to fixed it up :cry:
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Hi,

I'm no genius with regexp, but try this:

if {[regexp {^(\[0-9.\])+$} [set parsed [lindex [split $host @] 1]]]}

Hope that fixes it. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked