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.
Old posts that have not been replied to for several years.
z
zichta
Post
by zichta » Sun Apr 27, 2003 1:20 pm
hi, i cant find the error, plz help me
Code: Select all
bind pub - !news pub:news
proc pub:news { nick user handle channel arg } {
set url http://www.incorruptible.de/irc/irc_news.php
set tag news
set file news.tmp
put_cpu $url $tag $file $channel
}
proc put_cpu { url tag file channel } {
if { $channel!="#ic.news" &&
$channel!="#incorruptible.intern" } { return 1 }
exec lynx -preparsed -dump $url > $file
set f [open "$file" r]
set first 1
set tmp ""
while { [eof $f] != 1 } {
set l "[gets $f]"
set tmp "$tmp$l"
if { [string first </$tag> $tmp] != -1 } {
set out "[string range $tmp [expr [string first <$tag> $tmp] + [string length $tag] + 2 ] [expr [string first </$tag> $tmp] -1 ]]"
set out [fulltrim $out]
if { $first == "1" } {
putquick "PRIVMSG $channel :\003$out"
set first 0
} else {
putquick "PRIVMSG $channel :\003[string range $out 0 0]\003[string range $out 1 [string length $out]]"
}
set tmp "[string range $tmp [expr [string first </$tag> $tmp] + [string length $tag] + 3 ] [string length $tmp] ]"
}
}
close $f
}
proc fulltrim { tmp } {
while { [string first " " $tmp] != -1 } {
regsub -all " " $tmp " " tmp
}
return [string trim $tmp]
}
putlog "News 1.0 Loaded"
on type "!news", telnet prints "Tcl error [pub:news]: invalid command name """
- chmod is 777 on news.tmp
- the url works fine
- lynx works
- news.tmp was writed
cu
MC_8
Voice
Posts: 36 Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:
Post
by MC_8 » Sun Apr 27, 2003 1:59 pm
Find out what line is giving the error.
Throw some putlog "Got this far, continuing..." 's at every other line to see where it stops. This will help you narrow it down.
z
zichta
Post
by zichta » Sun Apr 27, 2003 4:26 pm
how does it works ? :/
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Sun Apr 27, 2003 4:59 pm
How does what work?
Don't tell me you wrote this script when you don't know what putlog is or know how to find out (hint: tcl-commands.doc)
You did not show us the entire error message btw...maybe we would be able to tell you more if you did.
MC_8
Voice
Posts: 36 Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:
Post
by MC_8 » Sun Apr 27, 2003 4:59 pm
How does putlog work? Umm, it puts information to the 'o' dcc console.
See tcl-commands.doc for a better explination.
Basically, if you have
Code: Select all
bla1
putlog "checkpoint 1"
bla2
putlog "checkpoint 2"
bla3
putlog "checkpoint 3"
And in DCC it shows:
checkpoint 1
checkpoint 2
ERROR ...
We know the error is a line between 2 and 3. 2 was the last displayed... so the error is "bla3". Once you figure out what line the error is in, you can find it easier :)