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.

reading eggdrop.conf

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

reading eggdrop.conf

Post by Ofloo »

how do i read the bots config file without getting errors ..? or executing that code ..??
XplaiN but think of me as stupid
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

make sure you wear glasses :wink:

could you please have another go at explaining, i didnt quite get it

Code: Select all

if {[catch {source your.tcl} error]} { putlog "$error"}

probably not what you want
photon?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

open eggdrop config in r mode read the data set it to variable without executing the content of that file and without causing any errors ..
make sure you wear glasses :p
maybe u should

source executes it and my question was not to execute it
XplaiN but think of me as stupid
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

open file and shove contents in variable without executing content

Code: Select all

set f [open "eggdrop.conf" r]
set c "[read $f]"
this does what you requested, though is most likely not what you want
photon?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

yes it was but i allready tryed it but for some reason its not working ..

i did

Code: Select all

set rfile [open eggdrop.conf r]
foreach line [split [read $rfile] \n] {
  #sock is where i send it to it allready exists.
  puts $sock "$line"
}
close $rfile
problem is only half of it arrives ..?
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm k stupid me i have been focusing on the config file while it was the socket that closed to fast how do i keep a server socket open long enough to send data true it and only close the sock after the data is send ..


the sock closes auto .. so i am not using close well on the end i do but ..

the syntax i use is

Code: Select all

server comand 555

proc command {sock ipaddr port} {
  fconfigure $sock -blocking 0 -buffering line
  gets $sock line
  #..script..
  close $sock
}

#error writing "sock13": connection reset by peer
i could not see this error so i tryed catching it with using an external file to load it with catch .. that was the result
XplaiN but think of me as stupid
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

It looks as though you are closing the connection after every gets (ie. whenever "command" is called...)...
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

no its on the end there is a sequence if elsif elseif ..else and on the end close $sock

Code: Select all

fconfigure $sock -blocking 0 -buffering line
i was thinking that this is the problem somehow ..
XplaiN but think of me as stupid
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

"Connection reset by peer" generally means the person who sent the data closed the socket before all of the data arrived. Maybe your test program that sends the file through the socket is exiting (not just closing the socket but actually exiting) before all the data is sent. One solution is to use an acknowledgement: send the file, wait for the server to send a reply like "ok". Another is to use fileevent writable to see when the socket isn't blocking (but I'm not totally sure if this will work 100%).

Also ofloo, I feel like you are kind of aggressive when people don't understand your questions and give "wrong" solutions, even though it's really your fault for not explaining it properly. Look at your initial post:

"how do i read the bots config file without getting errors ..? or executing that code ..??"

how do you A or B means, how do I A, or how do I B. Which in your case means "how do I read the bot's config file without getting errors, or how do I execute the code?"
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

as u sad just found out it is the client who disconnected not the socket .. tnx for the help.
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

how do you A or B means, how do I A, or how do I B. Which in your case means "how do I read the bot's config file without getting errors, or how do I execute the code?"
true but i didn't mean it agressive as he did a ;) i did a :p so it means to me that he was joking and i did the same thing so not sur what u mean by agressive

edited : hmm it seems that the :p is on the wrong line but i meanth to put it there sorry didn't mean to make it sound like that sorry spock

tnx for pointing that out stdragon
XplaiN but think of me as stupid
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Haha I don't know why I said it. I was feeling in a bad mood anyway. Not your fault!
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

np hehe ;)
XplaiN but think of me as stupid
Locked