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.

joinnotify.tcl does not work

Old posts that have not been replied to for several years.
Locked
N
Nailz

joinnotify.tcl does not work

Post by Nailz »

http://www.egghelp.org/files/tcl/joinnotify.tar.gz

When setup and ran it generates the following error:
[23:00] Tcl error [notify]: missing close-bracket


I have 0 coding skills so if anyone would be so kind to help me .. :o)

# notify you when any of theese nicks join your chan
set ppl "nick1 nick2"

# your email addy
set mail "email@addy.com"

# channels you want to monitor
set mailchans "#channel1 #channel2"

bind join - * notify
proc notify {nick uhost handle chan} {
global ppl mail mailchans

if {![file exists emptyfile] } {
set tempfile [open emptyfile w]
puts $tempfile " "
close $tempfile
}

if {([lsearch -exact [string tolower $ppl] [string tolower $nick]] != -1) && ([lsearch -exact [string tolower $mailchans] [$
putlog "$nick ($uhost) joined $chan, emailing $mail about it."
exec mail -s "$nick ($uhost) joined $chan" $mail < emptyfile
}
}
putlog "joinnotify.tcl v1.0 by greenbear loaded. "
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

replace

Code: Select all

if {([lsearch -exact [string tolower $ppl] [string tolower $nick]] != -1) && ([lsearch -exact [string tolower $mailchans] [$
with:

Code: Select all

if {([lsearch -exact [string tolower $ppl] [string tolower $nick]] != -1) && ([lsearch -exact [string tolower $mailchans]])} {


atleast this makes more sense than that code, but I think that your code has something missing "[$", I think it has a continuation or something.
N
Nailz

Post by Nailz »

Sir_Fz wrote: atleast this makes more sense than that code, but I think that your code has something missing "[$", I think it has a continuation or something.
Yes .. now that i've stared at the code for a few minutes my ancient 1990s Turbo Pascal skills got me thinking the same. :wink:

It still doesn't work though, I guess theres too much missing. Shame nobody checked the file on egghelp, was I really the first to run into this? I also ripped out the "create emptyfile" thing and replaced it with a file of my own cos I was getting errors with that as well. :|

Maybe you or anyone else can help me though to fix this? I know I can get the email part working under a trigger. But all this bind and join stuff just confuses me. :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Try this instead...

Code: Select all

if {([lsearch -exact [split [string tolower $ppl]] [string tolower $nick]] != -1) && ([lsearch -exact [split [string tolower $mailchans]] [string tolower $chan]] != -1)} {
Elen sila lúmenn' omentielvo
Locked