Stuck in the middle with Telnet

Hi

I am trying to write my own telnet client to connect to my favourite
MUD. (http://www.anguish.org/)

I'm stuck - I can't make it login at all ! I don't quite understand
the concept.

Do I use tn.cmd("mudcommand") to do pass the commands? Like :

input = gets.chomp #look at tree
tn.cmd(input) {|str| print str} #you look at a tree

here's what I have that doesnt work…note - If I just change the login
name (string) to guest and delete the password line - it does log in as
guest (which requires no password).

require 'net/telnet'

require 'net/telnet'
tn = Net::Telnet.new('Host' => 'ancient.anguish.org',
'Port' => '2222',
'Timeout' => 60,
'Telnetmode' => true) { |str| print str }

tn.cmd("Match" => "What is your name: ", "String" => "myname")
{ |str| print str }
tn.waitfor("Match" => "Password: ", "String" => "mypassword") {

str> print str }

Thanks

btw - I have also tried to make the password command a tn.cmd, tn.write
and tn.print but with no success.

Kingsley

Did you try with ‘tn.login(“me”, “let me in”)’?

Guillaume.

···

On Mon, 2003-06-30 at 10:14, kingsley@icecode.org wrote:

Hi

I am trying to write my own telnet client to connect to my favourite
MUD. (http://www.anguish.org/)

I'm stuck - I can't make it login at all ! I don't quite understand
the concept.

Do I use tn.cmd("mudcommand") to do pass the commands? Like :

input = gets.chomp #look at tree
tn.cmd(input) {|str| print str} #you look at a tree

here's what I have that doesnt work…note - If I just change the login
name (string) to guest and delete the password line - it does log in as
guest (which requires no password).

require 'net/telnet'

require 'net/telnet'
tn = Net::Telnet.new('Host' => 'ancient.anguish.org',
'Port' => '2222',
'Timeout' => 60,
'Telnetmode' => true) { |str| print str }

tn.cmd("Match" => "What is your name: ", "String" => "myname")
{ |str| print str }
tn.waitfor("Match" => "Password: ", "String" => "mypassword") {

str> print str }

Thanks

btw - I have also tried to make the password command a tn.cmd, tn.write
and tn.print but with no success.

Kingsley