Stuck with Telnet still

Hi

Hmm that doesnt work, I have to keep my finger on the return key to see
the server repsonse and it all comes out in a 1 character wide space -
each time I hit return it shows me another character.

I'm on a windows platform - did this code work for you ?

The only change I see was that you regex for quit - and break on that.
Which doesn't
help much unfortunately

Appreciated anyway

Kingsley

"K" == Kingsley Hendrickse KHendric@thoughtworks.com
writes:

···

On 07-04-2003 03:36 pm, you wrote:

I am still stuck with this telnet client :frowning:

Try something like this

svg% cat b.rb
#!/usr/bin/ruby
require 'socket'
require 'thread'

sock = TCPSocket.new('ancient.anguish.org',2222)
$stdout.sync = true

t1 = Thread.new do
while line = gets
sock.puts line
break if /^quit/ =~ line
end
end

t2 = Thread.new do
loop do
ch = sock.recv(1)
putc ch
end
end

t1.join

svg%

Guy Decoux

Hmm that doesnt work, I have to keep my finger on the return key to see
the server repsonse and it all comes out in a 1 character wide space -
each time I hit return it shows me another character.

I\'m on a windows platform - did this code work for you ?

svg% cat b.rb
#!/usr/bin/ruby
require 'socket'
require 'thread'

sock = TCPSocket.new('ancient.anguish.org',2222)
$stdout.sync = true

t1 = Thread.new do
   while line = gets
      sock.puts line
      break if /^quit/ =~ line
   end
end

t2 = Thread.new do
   loop do
      ch = sock.recv(1)
      putc ch
   end
end

t1.join

svg%
svg% b.rb

                                                           <\
                        ____________________________________>\ _
Welcome to... <___________________________________< >ZZZZZZZ(_)
                                                            >/
                    /| /| </
                   /~| N C I E N T /~| N G U I S H
          /\
  _ )( ______________________________________ LPMud 3.2.1@141
>_|NNNNN<()>______________________________________> (Native Mode)
          )(
          \/ A Realtime Multiuser Adventure Game

This world is Pueblo 1.0 enhanced.
Use Guest if you just want to look around.

What is your name: guest
You are now Guest.
                    Welcome back to YOUR /\_ncient /\_nguish

                         --== Founders: Zor, Drake ==--
  --== Archwizards: Adinos, Arpeggio, Malire, Oakram, Paldin, Scarecrazy ==--
    --== Senators: Buxley, Bytre, Dale, Dawg, Florin, Idul, Jerusulum ==--

** The donation drive is active! "help donations" for information.

[...]

    See 'help contest' and 'help contest.faq'
Your last login was from random places. Welcome to AA!
Your last login was 461 weeks, 1 day, 20 minutes and 10 seconds ago.
Baron Kilor the Knight Commander of the Realm (nice).
A gigantic trained dog.
Kerrick the Grand Knight and Protector of the Rose (neutral).
Dreaming the Treacherous Right Claw of the Black Bear (good).
A stone statue of Visitor.
A player usage graph hanging on the wall.

Kerrick says: nur klein genug muss er sein

Kilor leaves south.
help quit
command : quit
argument: none

Typing 'quit' will immediately quit the game. You will drop all items you
are currently carrying. All of your statistics (including gold on-hand and
in the bank, abilities, class, and guild association) are saved, and will be
restored the next time you enter Ancient Anguish. You will not start where
you quit, but will be returned to the village of Tantallon.

See also: save

Dreaming asks: gibts auch gigantic wolves?

quitMissliz enters the game.

svg%

The only change I see was that you regex for quit - and break on that.
Which doesn\'t
help much unfortunately

I've added

   $stdout.sync = true

Guy Decoux