egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with 1 old script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
suspect34
Voice


Joined: 11 Apr 2010
Posts: 4

PostPosted: Sun Apr 11, 2010 6:57 am    Post subject: problem with 1 old script Reply with quote

Hello i use an old script named knac.tcl
here is the script
Code:
###############################################
#
# KNAC ! Now playing on www.knac.com
#
# Usage :
#
# !knac
# Returns the title & artist of the song currently on air on www.knac.com
# Note : functionnal as of 10/2002. May not work when they modify their
# system, url or stuff :)
#
# Contact stuff :
# Ozh, ozh@planetquake, #SARL on irc.quakenet.org
###############################################

set knac_url "http://www.knac.com/text1.txt"

bind pub - !knac knac_get

proc knac_get {nick mask hand chan args} {
   global knac_url
   set file [open "|lynx -source $knac_url" r]
   set html "[gets $file]"

   regsub -all "<br>" $html " " html
   regsub -all "<\[^b]{0,1}b{0,1}>" $html "" html
   regsub "text1=" $html "" html
   regsub "NOW PLAYING:" $html "Now on www.knac.com: \002" html
   regsub "BY:" $html "\002, by \002" html

   putchan $chan $html
}

putlog "KNAC.tcl loaded ! If it's too loud, you're too old ! :)"
if i use !knac i get this error [/code]Tcl error [knac_get]: couldn't create error file for command: no such file or directory.
thanks for your time
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Sun Apr 11, 2010 7:34 am    Post subject: Reply with quote

what i wanted to do is to put that script into one of my bots, but then found out that i dont have lynx on my system and i dont want to install it (even though its possible to deinstall).

so i was thinking about possible errors, not really sure about it but you might want to try:

Code:

regsub -all "<\[^b]{0,1}b{0,1}>" $html "" html


the first [ is being escaped, but the second one isnt, escape it as well

furthermore theres no close tag for the file you opened. nevertheless i have to admit that im not really familiar with the error message "couldn't create error file for command". the only thing which could lead to something is "no such file or directory" which could mean that lynx wasnt found on the system?
Back to top
View user's profile Send private message
suspect34
Voice


Joined: 11 Apr 2010
Posts: 4

PostPosted: Sun Apr 11, 2010 7:51 am    Post subject: Reply with quote

Thanks for your replay , i will try to fix this but i don't know to much about tcl scripts i need to do a stats to get info from a web page to my irc channel
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Sun Apr 11, 2010 8:54 am    Post subject: Reply with quote

if you need help with something in particular just holla. if someone else is willing to install additional software or has lynx on his system already might want to try your existing script. from my point im only able to play a bit of guessing games and give you hints Wink
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Apr 11, 2010 12:41 pm    Post subject: Reply with quote

The error message "couldn't create error file for command: no such file or directory." usually originates from the exec command, and is usually related with windows systems. In this case, you are using open with a pipe, which is very similar to using exec, just that you gain control of both stdin and stdout.

What you need to do, in essence, is to redirect stderr (which is the cause of the issue) to stdout or some file. Have a look at this post: http://forum.egghelp.org/viewtopic.php?p=90869#90869
Although it deals with exec, not open, the solution should work equally well.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber