• Welcome to Valhalla Legends Archive.
 

Database.ocx

Started by Michael, September 28, 2007, 09:33 AM

Previous topic - Next topic

Michael

Well, here is a simple example of a database.ocx! (Uses flags)
It will save and load a database to either a file or your registry.
It can import a database from your bot, or export it to your bot.
Has standard built in commands.
Supports custom commands.

http://www.clangdn.com/mike/dbOCX.rar

i haven't tested anything yet.
i will still add some more things to it! but i guess this is the first version :)

any ideas on how to improve what i have done so far?

warz

you haven't tested anything? you just threw this all together, and released it, without making sure it works? yeah, i have an improvement suggestion - test what you've done so far.

also, commands / custom commands? how do those relate to a database specific library?

devcode

Quote from: betawarz on September 28, 2007, 11:35 AM
you haven't tested anything? you just threw this all together, and released it, without making sure it works? yeah, i have an improvement suggestion - test what you've done so far.

also, commands / custom commands? how do those relate to a database specific library?

Just about to say that.

brew

I don't get it. What is the point of having an ocx for this. It seems like nothing more then an extra file and a slower way of doing something you could already easily implement in your code.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Dale

Well done. Excellent Idea.

@Brew, No It's not an "extra file and a slower way of doing something you could already easily implement in your code."

Adding full support of functions for a database in Visual Basic isn't an 'easy implementation'. If I ever create a bot in Visual Basic again, I'll certainly use this OCX.

Quote from: betawarz on September 28, 2007, 11:35 AM
you haven't tested anything? you just threw this all together, and released it, without making sure it works? yeah, i have an improvement suggestion - test what you've done so far.

also, commands / custom commands? how do those relate to a database specific library?

I think what I meant by haven't tested anything yet, he means he's ran it, used it, it works, but he hasn't done any serious debugging yet. I think that's his way of saying, 'Can you test this for me?'

Camel

OCXes are not VB-specific; they're specifically designed to be language-independent.

VB already have an enormous amount of accessable windows API and VB-specific libraries to access databases through ODBC and various other methods. What does this OCX do that those libraries don't?

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Michael

I have updated it and tested the code (in a simulated environment).

Maybe i should have been more specific, it's a battle.net database control. loads the database, saves the database, checks for basic commands and such.

I am not asking for you to use it or if you think it's a good idea. I am asking for ways to make this "IDEA" better not if it's valid to your stand points. why write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects.    I released it here so other people could use it as well if they wished.

Warrior

There's an issue here, VB6 and redistributable libraries don't go hand in hand.
It's possible, but it's ugly.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Camel

I just want to know what it does; your description is very non-specific; give me the technical details. What databases does it support? How do you use it? Why is it useful?

Michael

it supports saving the database to the registry or to a file on your computer, and manages the users and such. it doesn't use mysql or anything like that atm, tho i may make it support mysql and maybe even getting files from the internet.

Camel

#11
Okay, I can see how that would seem useful to a VB developer now.

Have you considered using any other languages? I'd strongly recommend getting involved in an object-oriented language like Java or C#; they allow for solutions that are far more elegant, and much more pleasing to implement and use. For example, I wrote a URLDownloader as part of my bot's auto-update code the other day:
http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/util/URLDownloader.java

The code boils down to this:
public static void downloadURL(URL url, File to) throws IOException {
...
DataInputStream is = new DataInputStream(new BufferedInputStream(url.openStream()));
FileOutputStream os = new FileOutputStream(to);
byte[] b = new byte[0x1000];
do {
int c = is.read(b);
if(c == -1)
break;
os.write(b, 0, c);
} while(true);

os.close();
is.close();
...
}


[edit] Just found an example that's even better at getting my point across: my CookieUtility class. It generates 32-bit cookies for battle.net, allowing the bot to be fully asynchronous (even though it isn't). It has two methods: int createCookie(Object) and Object destroyCookie(int) - their use should be straightforward. Check it out: http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/util/CookieUtility.java

Michael

I plan on learning other languages in college. Until college starts i plan to just have fun gaming and work on a little project here and there.

Yegg

Quote from: -MichaeL- on October 02, 2007, 10:14 AM
I plan on learning other languages in college. Until college starts i plan to just have fun gaming and work on a little project here and there.

College won't teach you that much. You can learn more on your own as far as different programming languages goes. Waiting until college begins to do that is not a good idea. College will provide you with a bigger workload than high school and if you also have a job on top of all that, you won't have time to be learning other languages.

Camel

Most of my CS friends from my freshman year of college that took that additude continued to take it through college, through falling way behind, and through dropping out. Learn as much as you can while you have the chance - the older you get, the harder it will be to pick up new things. There's more to being a resourceful software developer than just being a good programmer; I'd also suggest looking in to databases (MySQL is a great place to start), since it's something you'll need in many real-world applications.