Stuck in the middle with Telnet

Discussion in 'Ruby' started by kingsley@icecode.org, Jun 30, 2003.

  1. Guest

    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
    , Jun 30, 2003
    #1
    1. Advertising

  2. Did you try with 'tn.login("me", "let me in")'?

    Guillaume.

    On Mon, 2003-06-30 at 10:14, 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
    >
    Guillaume Marcais, Jun 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick Spiewak
    Replies:
    1
    Views:
    415
    Rick Spiewak
    Jul 22, 2003
  2. Jim Isaacson
    Replies:
    5
    Views:
    593
    Default User
    Nov 5, 2004
  3. JT
    Replies:
    17
    Views:
    535
    Mabden
    Sep 27, 2005
  4. Kingsley Hendrickse

    Stuck with Telnet still

    Kingsley Hendrickse, Jul 4, 2003, in forum: Ruby
    Replies:
    0
    Views:
    148
    Kingsley Hendrickse
    Jul 4, 2003
  5. Carcarius
    Replies:
    0
    Views:
    275
    Carcarius
    Dec 6, 2007
Loading...

Share This Page