[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Net::Telnet and sysread

Will Shattuck

1/5/2006 6:24:00 AM

I'm trying establish a telnet connection to nethack.alt.org. I canget a connection but Net::Telnet cannot seem to handle the output. Inreading net/telnet.rb I found out about IO#sysread so i put thislittle tnet.rb file togetherrequire 'net/telnet'print("\n")tn = Net::Telnet.new( 'Host' => 'nethack.alt.org', 'Timeout' => 10, 'Telnetmode' => true) { |str| print str }input = tn.sysread(1024 * 1024)print("\nDisplaying Output\n ")print(input)Now when I connect here is the output that is displayed:E:\Ruby\mkNethackbot>ruby tnet.rbTrying nethack.alt.org...Connected to nethack.alt.org.Displaying Output ²? ² ²# ²'E:\Ruby\mkNethackbot>As you can see from the "Displaying Output" section the data thatnethack.alt.org is sending doesn't seem readable by Net::Telnet. nethack.alt.org appears to use a scripted login instead of a standardlogin/password prompt.Any ideas?Thanks,Will--Will Shattuck ( willshattuck.at.gmail.com )Home Page: http://www.thewholeclan.co... you get to your wit's end, you'll find God lives there.