• Welcome to Valhalla Legends Archive.
 

[VB] Good Bot Programming Practices?

Started by Tontow, July 08, 2005, 05:23 PM

Previous topic - Next topic

Tontow

Quote from: Kp on July 15, 2005, 09:27 PM
Quote from: Tontow on July 14, 2005, 11:03 PMBut wouldn't it be better/faster if I eliminate the need for a secondary buffer? Why double buff when you can avoid it?

I find it absolutely hilarious that someone determined to do this in VB cares about speed. VB is meant to be written quickly and run slowly. If you care about performance, use a real language.

:P :P :P

Quote from: Warrior on July 15, 2005, 09:35 PM
Nothing wrong with using vb to the max while you're programming in it ;)

Thank you.  I believe that everything can be translated from one programming language to another, including both good and bad programming habits.  Thus, I want to do the best job I possibly can instead of producing something that looks like I wiped my ass with.

MyndFyre

Quote from: Tontow on July 15, 2005, 09:48 PM
Thank you.  I believe that everything can be translated from one programming language to another, including both good and bad programming habits.  Thus, I want to do the best job I possibly can instead of producing something that looks like I wiped my ass with.
Still, though, there are different kind of habits used in different settings.  I again reiterate that Code Complete is an invaluable resource.  Your habits should reflect what you're going for -- code reuse, code portability, RAD.  My current project is aiming primarily for code reuse and portability, and so almost everything that I'm designing is deliberate, structured, and abstract.  If you're using RAD, you might not worry about code portability (for example, in my project, I have generic collections for compilation in .NET 2.0.  I pretty much only write code in VS.NET 2003 (.NET 1.1), but whenever 2.0 is released, I'll be ready to support either platform.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Chriso

Quote from: UserLoser on July 11, 2005, 11:45 AM
Quote from: Tontow on July 11, 2005, 11:05 AM
Quote from: Kp on July 09, 2005, 12:22 AM
  • detect when a full message is ready

How/what would be the best way to do that?

I'm guessing that I need to:

Use socket.getdata data, vbArray + vbByte to retrieve the data as a byte array.

And since all packets have a message length, that also includes the header, I should create an equivalent to SOCKET.BytesReceived to detect when a full message is ready.



You're better off with Socket.GetData(Data, vbString)..  It would probably be vbArray Or vbByte anyways, and I doubt it would work also.  A byte array could be pretty much the same thing as a string.  You're using VB, so just stick to a string.

I use Socket.PeekData(Data, vbString) first to check if there is any data.

UserLoser.

Quote from: DDA-TriCk-E on August 16, 2005, 06:41 PM
I use Socket.PeekData(Data, vbString) first to check if there is any data.

What's the point?  The DataArrival event will only be fired if there's any data received

|