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.

how to login to telnet and then read any information.

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
AUTIST
Voice
Posts: 20
Joined: Sun Feb 01, 2004 8:52 am

how to login to telnet and then read any information.

Post by AUTIST »

Hi guys,
could you please help me. I need to connect from my bot to telnet on other server and reading some stuff from there.
I think it needs to use sockets, but I don't know how can I login and then reading info from connection.

Code: Select all

set somesock [socket "127.0.0.1" 23]
And what should I do to make a login? and the read. Please help.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
AUTIST
Voice
Posts: 20
Joined: Sun Feb 01, 2004 8:52 am

Post by AUTIST »

Hi, looks like you didnt understand, or may be my english is very bad :)

I don't need to connect to bot, or from bot to another bot.

I have a telnet server, and when I connect to that server I can see some codes, links, some useful stuff for me.
I need a script which can coonnect to that server to port 23, login, and then read some information from there and put it to specified chan.
I think something like that:
!connect <some-ip> <telnet-port>
bot respons is connected or not connected
if connected he will be put line by line from the telnet session to channel during it appears in remote server
User avatar
AUTIST
Voice
Posts: 20
Joined: Sun Feb 01, 2004 8:52 am

Post by AUTIST »

This code is connectiong to DBOX, but I cannot recieve any data from there

Code: Select all

if {[catch {set sock [socket "dbox" 23]} sockerr]} {
	puts "$sockerr"; puts "not connected"; return
} else {
	puts "connected"
}

flush $sock
puts "123"
while {![eof $sock]} {
set line [gets $sock]
puts $line
}

close $sock
The result is:

Code: Select all

%tclsh test.tcl
connected
123
_ (<- carrige flashing)
And carrige flashing and nothing...
User avatar
AUTIST
Voice
Posts: 20
Joined: Sun Feb 01, 2004 8:52 am

Post by AUTIST »

Anybody could help? Please!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

check out Expect
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply