ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Re: bot classes (Sdk)
Re: bot classes // SdkbrantMay 21, 2002, 11:21am
Well, in reply to your question, I was originally going to write this secret
project in C++. I decided against doing so for two reasons. 1. I have hundreds of pages of code already written to do just about anything with the SDK that could be easily changed to do what this particular bot is designed for. In C++, I would have to rewrite all that code from scratch. 2. While I've written a lot of programs using console functions in C++, I have no knowledge of how to use the Windows API to create nice looking forms. I should probably learn how to use it, but doing so would push the completion of the project back beyond next week, AFTER 3.3 is released. Plus, VB offers a lot of ease in debugging that will allow me to get a project that doesn't necessarily rely on speed off the ground quickly. The only problem with VB is that inheritance is not supported (I believe VB.net supports it though), meaning that the only way I can add application-specific reactions to SDK events is to create a "generic module" which has a set of subroutines that are called after the class processes events. In the AvatarAdd event, for example, the class first manages the list of avatars (used in all applications), and then passes a reference of the "Bot" object to a global Sub for actions taken by this specific application. It's somewhat sloppy to have to create a "dummy module" with just the prototypes and no implementation and then make a copy to modify each time you want to write a bot - but it's the best VB offers, unless someone else has a better idea how this could be implemented. By the way, in case anyone is wondering, I plan to release all of these classes to the public in the hopes of spurring on interesting bot development. The code won't be compiled into a DLL - it will be released as the original source so everyone can take a look - stay tuned :) [View Quote] |