Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Telnet chat Bot client

by tucano (Scribe)
on May 26, 2004 at 23:51 UTC ( [id://356760]=CUFP: print w/replies, xml ) Need Help??

i want to make a chat client: SERVER -> jdkchat server (is a small c++ code that create a telnet server) So now i need a client from the http site.... ... i'm not an hard programmer and i have some problems with c... so i try this
#!/usr/bin/perl use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Port=>2001, Prompt => '/bash\$ $/' ); $telnet->open('localhost'); @welcome = $telnet->waitfor('/Your Name:$/i'); print @welcome; $name = <STDIN>; chomp $name; $telnet->print($name); $telnet->waitfor('/>$/i'); $telnet->print('ciao io sono un bot!'); $telnet->waitfor('/>$/i'); $telnet->print('ora faccio un who'); @who=$telnet->print('/who'); @output = $telnet->waitfor('/>$/i'); print @output,"\n"; unless ($parol eq 'exit') { $parol = <STDIN>; $telnet->print($name); @output = $telnet->waitfor('/>$/i'); print @output,"\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://356760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2026-04-18 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.