| View previous topic :: View next topic |
| Author |
Message |
AUTIST Voice

Joined: 01 Feb 2004 Posts: 20
|
Posted: Tue Nov 01, 2005 11:39 pm Post subject: how to login to telnet and then read any information. |
|
|
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: | | set somesock [socket "127.0.0.1" 23] |
And what should I do to make a login? and the read. Please help. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Nov 02, 2005 2:20 am Post subject: |
|
|
Using Your Eggdrop _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
AUTIST Voice

Joined: 01 Feb 2004 Posts: 20
|
Posted: Wed Nov 02, 2005 10:41 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
AUTIST Voice

Joined: 01 Feb 2004 Posts: 20
|
Posted: Wed Nov 02, 2005 11:31 am Post subject: |
|
|
This code is connectiong to DBOX, but I cannot recieve any data from there
| Code: | 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: |
%tclsh test.tcl
connected
123
_ (<- carrige flashing)
|
And carrige flashing and nothing... |
|
| Back to top |
|
 |
AUTIST Voice

Joined: 01 Feb 2004 Posts: 20
|
Posted: Thu Nov 03, 2005 3:42 pm Post subject: |
|
|
| Anybody could help? Please! |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Nov 04, 2005 1:27 am Post subject: |
|
|
check out Expect _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
|