From: kingsley@... Date: 2003-07-01T00:35:15+09:00 Subject: Re: Stuck in the middle with Telnet yes I did and no luck But the documentation says login used login: and password: to match against - my mud used What is your name: and password: On 06-30-2003 04:14 pm, you wrote: > 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 > > > > > > >