User Control Panel
Advertisements

HELP US, HELP YOU!

msn console client

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Ideas
View unanswered posts
Author Message
kilogramo
Newbie
Newbie


Joined: 30 Jul 2006
Posts: 2


PostPosted: Tue Sep 05, 2006 2:08 pm    Post subject: msn console client Reply with quote

Hello, is there any msn console client using MSN.pl? It would be niche to have one. Thanks.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Sep 05, 2006 3:38 pm    Post subject: Reply with quote

I haven't seen anybody make one yet, mainly for a pretty simple reason:

Perl is by default a single-threaded program, and to have a console MSN client, <STDIN> would have to be used in order to get user input through the console. However, <STDIN> doesn't return until the user types something and hits enter, causing the rest of the script to pause until it does so.

With a paused script, the program couldn't ping MSN's servers to find new information, so you wouldn't get any new IM's people are sending until you send a message. Not only that, but if the client doesn't ping MSN's servers often enough, MSN disconnects them.

That being said, most people I've seen who tried to do something like this have failed.

There are some solutions such as using Term::ReadKey and threads (to make a second thread for typing in commands while not interfering with the main MSN thread), but they're a little bit more complicated.

But I don't know of anybody who's done this. Pretty much everyone I know who knows how to use Term::ReadKey or threads also knows how user friendly a console MSN client would be (which is, not very user friendly at all). For instance, your typing would be interrupted by messages and you might lose your place:

Code:
Send Message> hey Joh[16:32:06] John: hey!

n, can you send me an e-[16:32:30] Mike: so did you finish that homework assignment yet?

mail with a link to th[16:33:02] John: what's up?

e login page?


See, that's some potential output of a console MSN client. You'd be simply trying to type "Hey John, can you send me an e-mail with a link to the login page?" but as you're typing, your other friends are sending messages which are also printed out to the same console window you're typing in, which visually interrupts your typing and if you lose your place it's hard to find what you've already written to pick up where you left off.

So, the newbies can't get over the threading problem, and the experienced coders realize how inefficient it is.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Wed Sep 06, 2006 8:11 am    Post subject: Reply with quote

Ive seen things like this done with ANSI locate and things like that... where you can set he position on the console of text that you write. That way you can make it not over write the text you type.

Term::ReadKey can be used instead of threads to make the input non-blocking (unlike STDIN). Term::ReadKey basically waits of one key to be pressed, but you can time this out to wait less than a second for a new key. You can then append each character you get to a string until you get a return character, then send that string.

If you want to use threads you can make a sheared thread array that you could use as a "buffer" that your STDIN loop writes to and your threaded msn loop then reads.

I may give this some more thought and work something like this out. It could definitely be fun.

_________________
[ matt ]
Back to top
ERijkee
Newbie
Newbie


Joined: 05 Jul 2004
Posts: 31
Location: Almere, The Netherlands
Reputation: 35.4Reputation: 35.4Reputation: 35.4Reputation: 35.4

PostPosted: Wed Sep 06, 2006 9:49 am    Post subject: Reply with quote

Look at this: http://tmsnc.sourceforge.net/
Its not made in Perl, but it does show it is perfectly possible.
I'm going to try it now, on linux because it doesnt work on windows.

_________________
3D chat program I'm making Smile
Back to top
kilogramo
Newbie
Newbie


Joined: 30 Jul 2006
Posts: 2


PostPosted: Wed Sep 06, 2006 11:53 am    Post subject: Reply with quote

sure it is possible, it would be great to have one!!!
Back to top
ERijkee
Newbie
Newbie


Joined: 05 Jul 2004
Posts: 31
Location: Almere, The Netherlands
Reputation: 35.4Reputation: 35.4Reputation: 35.4Reputation: 35.4

PostPosted: Wed Sep 06, 2006 1:00 pm    Post subject: Reply with quote

I tried it and its not bad, it behaves a lot like a graphical window. Impressive for just text Smile
_________________
3D chat program I'm making Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Ideas All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group