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.

Problem script counter

Old posts that have not been replied to for several years.
Locked
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Problem script counter

Post by ranny »

Hello everyone,

I made this small script
bind pub - * counter
proc counter {nick uhost handle channel arg} {
global counternumber
set counternumber($nick) [regexp -all -nocase {[A-Z][0-9]} $arg]
}

bind pub - !count countera
proc countera {nick uhost handle channel arg} {
global counternumber
putserv "privmsg $channel :$counternumber($nick)"
}
but that returns this error:can't read "counternumber(lorenbarre)": no such variable

if somebody can help me.

thank you
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

change first [bind pub] to [bind pubm]
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

hello, thank you demond, it's good.
Another question, why with

Code: Select all

[regexp -all {:)} $arg]
I have this error message:Tcl error [counter]: couldn't compile regular expression pattern: parentheses () not balanced ??

Thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Use

Code: Select all

[regexp -all {:\)} $arg]
instead.
Locked