User Control Panel
Advertisements

HELP US, HELP YOU!

Without msn.pm
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Getting Started
View unanswered posts
Author Message
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 5:23 pm    Post subject: Without msn.pm Reply with quote

*brushes dust off self* I return!

I took a break from programming my bot and did some other programming for a while (databases, games etc.) but I have returned but with slightly different intentions.

I am trying to make an MSN client (using the Tk modules) with a "bot-buddy" sort of thing, however, because the client will be only very simple (pretty much just IM, maybe display pictures/personal messages too) I want to program my client without msn.pm (not that I don't think its an outstanding piece of work).

I have drawn against a problem though, which I cannot solve by examining msn.pm (Which I have done) in it's method. The problem is reading from the socket connected to the MSN servers. I can't figure out how it knows when to read it so it doesn't block (useful as it will need to interact with the user).

Could anyone explain how it does this so I can progress with my client?

NOTE: I have found a semi-way around it by pinging the server in the socket reading loop and dropping out the loop when the reply from the ping is recieved, so it can update the client, though the problems with this are obvious (client "freezes" if reply from ping is never received for whatever reason)
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Oct 12, 2005 5:43 pm    Post subject: Reply with quote

I guess my question is why don't you want to use MSN.pm? It is simple, it does simple IM and display pictures. What complicated things does it do that you don't need?
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Oct 12, 2005 5:50 pm    Post subject: Reply with quote

(And why not just delete the "complicated things"?)
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 5:52 pm    Post subject: Reply with quote

I guess it's more just the challenge of handling it all myself and I want to avoid using modules wherever possible and use my own code.
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Oct 12, 2005 5:54 pm    Post subject: Reply with quote

When you say "avoid modules" you mean avoid pre-made modules, right? You're still gonna modularise it?
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 5:56 pm    Post subject: Reply with quote

I don't know how to write modules, all the code will be in the "executable" code, but yes I meant premade modules
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Wed Oct 12, 2005 6:00 pm    Post subject: Reply with quote

I don't see the use in reinventing the wheel. If you protest using modules all the time, you'd be doing a LOT more work to do little things (which the modules would handle) rather than actually program your program...

i.e. you would spend a lot more time on the MSN connection part than you'd even do with using PerlTk (or why not just skip the Tk modules and write a GUI yourself too?)

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 6:07 pm    Post subject: Reply with quote

My dislike to using modules mainly stems from when I try to compile an executable. I've used about 3 different things to try and do this and every one complains about modules...

I suppose using modules makes it... too easy and the challenge goes. Though I guess it may be a good idea that for the time being I use modules and once I have it working start "extracting" the modules into my own code to make it self-reliant.
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Oct 12, 2005 6:13 pm    Post subject: Reply with quote

Large files of code make the program inefficient. Splitting it up means it only needs to exucute the seperate file rather than everything at once.

Why not use PerlApp that comes with the PDK?

http://www.activestate.com/Products/Perl_Dev_Kit/

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 6:22 pm    Post subject: Reply with quote

I thought when you used modules it loaded/read it all at compile so it wouldn't make any difference if the code was in the same file, if not making it faster by having the code in one place...
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Oct 12, 2005 6:59 pm    Post subject: Reply with quote

Quote:
I suppose using modules makes it... too easy and the challenge goes.


haha, in that case you have set very low goals for yourself. I use modules to avoid the boring stuff. For me, the MSN module is a useful tool to write much more interesting code on top of. Set some higher goals and you'll get plenty of challenges. Rehashing your own msn is a pretty low goal.

If you want it fast and you're rewriting everything from scratch, why not use C?
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 7:12 pm    Post subject: Reply with quote

Low goals = achievable

Very Happy
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Oct 12, 2005 7:21 pm    Post subject: Reply with quote

What I really meant to say is that it's been done. Sure MSN.pm could be improved, extra features added, etc., but the basic code you need to write an MSN bot is there. If it didn't work, then rewriting it would make sense. But it does. So, at least for me, rewriting it means recreating something rather than building on top of something. If you're just doing it to learn how the MSN protocol works and develop your skills, cool. I'm just thinking it's more interesting to create something new.
Back to top
Xyem
Young One
Young One


Joined: 03 Jan 2005
Posts: 54

Reputation: 17.4Reputation: 17.4

PostPosted: Wed Oct 12, 2005 7:28 pm    Post subject: Reply with quote

I understand exactly what you mean Mojave, our whole society and technology is based on building on top of what we have. But your right, I am interested in learning the MSN protocol and want to deal with it directly
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Wed Oct 12, 2005 7:58 pm    Post subject: Reply with quote

With PerlApp in the Perl Dev Kit, you can *compile* your program into a standalone executable.

If you were planning on leaving your code as Perl to be interpreted at runtime, then you can always just include some of its harder-to-find modules with it when you zip it. i.e. your program could have its own "lib" folder, and you can use lib to use that. That's what my Perl programs tend to do oftentimes.

But if you meant compile as in turn it into an EXE, the PerlApp handles that VERY well. It's actually easier to use modules with PerlApp than to use normal Perl includes, because PerlApp compiles all the modules together into the final one-file standalone EXE.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Getting Started All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



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