Valhalla Legends Forums Archive | Battle.net Bot Development | Re: Database.ocx

AuthorMessageTime
-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?
September 28, 2007, 2:33 PM
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?
September 28, 2007, 4:35 PM
devcode
[quote author=betawarz link=topic=17064.msg173359#msg173359 date=1190997333]
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?
[/quote]

Just about to say that.
September 28, 2007, 5:37 PM
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.
September 28, 2007, 7:16 PM
dlStevens
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 author=betawarz link=topic=17064.msg173359#msg173359 date=1190997333]
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?
[/quote]

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?'
September 28, 2007, 8:40 PM
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?
September 28, 2007, 9:02 PM
rabbit
Go slowly?
September 29, 2007, 2:44 AM
-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.
September 30, 2007, 11:07 AM
Quarantine
There's an issue here, VB6 and redistributable libraries don't go hand in hand.
It's possible, but it's ugly.
September 30, 2007, 1:59 PM
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?
October 1, 2007, 2:48 AM
-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.
October 1, 2007, 12:42 PM
Camel
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:
[code] 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();
...
}[/code]

[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: [tt]int createCookie(Object)[/tt] and [tt]Object destroyCookie(int)[/tt] - their use should be straightforward. Check it out: http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/util/CookieUtility.java
October 1, 2007, 6:36 PM
-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.
October 2, 2007, 3:14 PM
Yegg
[quote author=-MichaeL- link=topic=17064.msg173454#msg173454 date=1191338085]
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.
[/quote]

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.
October 3, 2007, 2:20 AM
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.
October 3, 2007, 3:10 AM
rabbit
So far college sucks.  I've learned Maple and Matlab.  And a little bit of AutoCAD.  Wonderful.  Now I can make a 3d graph of a bolt.  What good does that do for lockdown?
October 3, 2007, 4:19 AM
Yegg
[quote author=rabbit link=topic=17064.msg173485#msg173485 date=1191385157]
So far college sucks.  I've learned Maple and Matlab.  And a little bit of AutoCAD.  Wonderful.  Now I can make a 3d graph of a bolt.  What good does that do for lockdown?
[/quote]

I agree. Only, they're making us do general education the whole first semester. I'm failing Psychology with a 53.
October 3, 2007, 4:22 AM
Barabajagal
You'll bitch about it, but you won't agree with me that standardized education needs complete reform?
October 3, 2007, 4:34 AM
bethra
Waiting until college to experience the hell that is switching from VB6 to a language like C/C++ or Java is a bad idea.  This is hell is amplified even more by having to kick the bad habits VB6 programming gives you.  I'm tempted to even say that you'd be at a disadvantage compared to those capable freshman who've never even programmed before.
October 3, 2007, 10:41 AM
-MichaeL-
[quote author=Andy link=topic=17064.msg173487#msg173487 date=1191386061]
You'll bitch about it, but you won't agree with me that standardized education needs complete reform?
[/quote]
I agree, what pisses me off the most in high school i requested computer networking. What did i get? FRENCH!!! Still bothers me to this day that people who cant even do fractions got in that class over me. On a good side note though the teacher got fired two years later for misconduct with the female students and everyone who went to the class never got there certificate as it requires 3 years. GG


[quote author=Sorc.Polgara link=topic=17064.msg173491#msg173491 date=1191408074]
Waiting until college to experience the hell that is switching from VB6 to a language like C/C++ or Java is a bad idea.  This is hell is amplified even more by having to kick the bad habits VB6 programming gives you.  I'm tempted to even say that you'd be at a disadvantage compared to those capable freshman who've never even programmed before.
[/quote]

Yeah, but i cant find any good sites that work with my visual studio 6.0 vc++.
October 3, 2007, 5:44 PM
Camel
Java is free!
October 3, 2007, 10:31 PM
St0rm.iD
And cross platform!
October 3, 2007, 11:32 PM
UserLoser
Sex is free and cross-gender compatible, doesn't mean it's good.  [s]Kind of[/s] like Java
October 4, 2007, 1:05 AM
Barabajagal
Ya... my friend used to give me a "Joys of Java" rant every day when he was taking it, so I took it the next year. He was right.
October 4, 2007, 1:47 AM
Camel
[quote author=UserLoser link=topic=17064.msg173512#msg173512 date=1191459947]
Sex is free and cross-gender compatible, doesn't mean it's good.  [s]Kind of[/s] like Java
[/quote]

I don't usually turn down sex.
October 4, 2007, 2:47 AM
MyStiCaL
[quote author=Camel link=topic=17064.msg173518#msg173518 date=1191466037]
[quote author=UserLoser link=topic=17064.msg173512#msg173512 date=1191459947]
Sex is free and cross-gender compatible, doesn't mean it's good.  [s]Kind of[/s] like Java
[/quote]

I don't usually turn down sex.
[/quote]

really.. low standerds?
October 4, 2007, 6:28 AM
Camel
I didn't say I never turn down sex; just not usually.
October 4, 2007, 6:10 PM

Search