Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: After-Death on January 22, 2004, 07:34 AM

Title: Bots in Java - info please!
Post by: After-Death on January 22, 2004, 07:34 AM
Are there any open source bots written in Java?

Im interested in writing a bot in Java but I can't read C or VB particularly well so it would be easier to find a Java bot.
Title: Re:Bots in Java - info please!
Post by: ChR0NiC on January 22, 2004, 07:41 AM
I believe.....DM Bot made by Dark Minion is an open source C++ bot.....I do not have the source, because I am not learning C++ but I am sure some people have it,
Title: Re:Bots in Java - info please!
Post by: warz on January 22, 2004, 07:45 AM
Quote from: After-Death on January 22, 2004, 07:34 AM
Are there any open source bots written in Java?

Im interested in writing a bot in Java but I can't read C or VB particularly well so it would be easier to find a Java bot.

He's asking for Java, not C++.
Title: Re:Bots in Java - info please!
Post by: ChR0NiC on January 22, 2004, 07:48 AM
Quote from: After-Death on January 22, 2004, 07:34 AM
Are there any open source bots written in Java?

Im interested in writing a bot in Java but I can't read C or VB particularly well so it would be easier to find a Java bot.

Quote from: warz on January 22, 2004, 07:45 AM
He's asking for Java, not C++.

Maybe I was informed....but aren't they pretty much the same thing?? This is what I was told.....
Title: Re:Bots in Java - info please!
Post by: warz on January 22, 2004, 07:56 AM
Similar.
Title: Re:Bots in Java - info please!
Post by: iago on January 22, 2004, 07:58 AM
Quote from: ChR0NiC on January 22, 2004, 07:48 AM
Quote from: After-Death on January 22, 2004, 07:34 AM
Are there any open source bots written in Java?

Im interested in writing a bot in Java but I can't read C or VB particularly well so it would be easier to find a Java bot.

Quote from: warz on January 22, 2004, 07:45 AM
He's asking for Java, not C++.

Maybe I was informed....but aren't they pretty much the same thing?? This is what I was told.....

You were MISinformed.  Although they are similar in many ways, and it's easy to learn one when you know the other, they are by no means the same.


Back to the question - I don't know of any open source Java bots.  I have an open source javabot that only supports chat, if you want.  It's at
http://www.valhallalegends.com/iago/JavaBot.rar or
http://www.valhallalegends.com/iago/JavaBot-gui.rar
Keep in mind that that's a working name, and I'm slowly putting work into making it a real bot, but it doesn't look like that's going to happen anytime soon.  And when it does, it probably won't be opensource.
Title: Re:Bots in Java - info please!
Post by: ChR0NiC on January 22, 2004, 08:06 AM
Is Java supported by any Microsoft based programs? like Visual Java or something
Title: Re:Bots in Java - info please!
Post by: After-Death on January 22, 2004, 09:11 AM
Thanks for the source iago, it is quite useful.

Im not sure Im gonna be able to cope with programming a bot though :/
Title: Re:Bots in Java - info please!
Post by: iago on January 22, 2004, 10:44 AM
Quote from: ChR0NiC on January 22, 2004, 08:06 AM
Is Java supported by any Microsoft based programs? like Visual Java or something

C# is similar to Java...

I would suggest getting the new java SDK with NetBeans.  NetBeans is the best IDE I've ever used.
Title: Re:Bots in Java - info please!
Post by: After-Death on January 22, 2004, 12:41 PM
I've been using Eclipse .. it seems to do the job.

What java books do you recommend? I have a firm grasp of OOP and basics of programming but I need to get into Java quickly. Unfortunately I haven't found much useful info on the internet, and relevant networking code seems to be scarce (or I'm looking for the wrong stuff).
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 12:56 PM
Quote from: ChR0NiC on January 22, 2004, 08:06 AM
Is Java supported by any Microsoft based programs? like Visual Java or something

ugh, Windows kids and graphical everything.  Blech.

If you can stand having a command line interface, there's a java compiler from Sun for Windows (and for other OSes, but since you asked for something Microsoft-based, I assume you want a Windows application).
Title: Re:Bots in Java - info please!
Post by: K on January 22, 2004, 01:12 PM
Quote from: iago on January 22, 2004, 07:58 AM
...And when it does, it probably won't be opensource.

Just curious; how are you planning on accomplishing that? obfuscation? compiling to native code?
Title: Re:Bots in Java - info please!
Post by: After-Death on January 22, 2004, 01:30 PM
Why use a command line when you have a GUI ? It's about programming not being old school.

Anyway.

I ran netbeans and it couldn't load jvm.dll

Title: Re:Bots in Java - info please!
Post by: ObsidianWolf on January 22, 2004, 01:47 PM
http://www.netbeans.org/kb/

Look there for help, Im trying to recreate the error myself that you spoke of in hopes of helping you.

No such luck yet, 4 Good Installs.

Question... When Prompted to Save file to disk or Open...

DId you choose save?
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 22, 2004, 02:16 PM
Quote from: After-Death on January 22, 2004, 07:34 AM
Are there any open source bots written in Java?

Im interested in writing a bot in Java but I can't read C or VB particularly well so it would be easier to find a Java bot.

I am working on a guide to creating Battle.net bots. All examples will be written in Java to start with, so when it is released it may be of some help to you.
Title: Re:Bots in Java - info please!
Post by: iago on January 22, 2004, 02:18 PM
Quote from: K on January 22, 2004, 01:12 PM
Quote from: iago on January 22, 2004, 07:58 AM
...And when it does, it probably won't be opensource.

Just curious; how are you planning on accomplishing that? obfuscation? compiling to native code?

By not releasing it at all is the easiest way, since I'm writing it for myself :)
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 02:31 PM
Quote from: After-Death on January 22, 2004, 01:30 PM
Why use a command line when you have a GUI ? It's about programming not being old school.

It's not about being old school.  It's about efficiency.  I've found that I can update my project settings more easily, rebuild just as quickly, and generally design better overall by NOT using an IDE.  In particular, I've never seen an IDE that had a decent inline editor, and that's the only reason I'd consider an IDE over a command line environment.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 22, 2004, 02:38 PM
Quote from: Kp on January 22, 2004, 02:31 PM
Quote from: After-Death on January 22, 2004, 01:30 PM
Why use a command line when you have a GUI ? It's about programming not being old school.

It's not about being old school.  It's about efficiency.  I've found that I can update my project settings more easily, rebuild just as quickly, and generally design better overall by NOT using an IDE.  In particular, I've never seen an IDE that had a decent inline editor, and that's the only reason I'd consider an IDE over a command line environment.

I use JCreator, which offers syntax coloring (makes it easier for me to work with because I am a visual person), compiles my project for me with the push of a button (laziness perhaps ;D), and helps keep it organized for me. I am not doubting what you are saying because I do see the benefits of not using a IDE. My question is how does it help you to design your projects better not using an IDE? I design all my projects on paper, so I don't see how it would be a burden. The main issue with IDE's to me is all the auto-complete and lookup features. I don't think people really learn when all they have to do is get part of it correct, and the IDE does the rest for them. That's why I learn a language without an IDE, and then move to one later.
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 02:48 PM
Quote from: Tuberload on January 22, 2004, 02:38 PM
I use JCreator, which offers syntax coloring (makes it easier for me to work with because I am a visual person), compiles my project for me with the push of a button (laziness perhaps ;D), and helps keep it organized for me. I am not doubting what you are saying because I do see the benefits of not using a IDE. My question is how does it help you to design your projects better not using an IDE? I design all my projects on paper, so I don't see how it would be a burden. The main issue with IDE's to me is all the auto-complete and lookup features. I don't think people really learn when all they have to do is get part of it correct, and the IDE does the rest for them. That's why I learn a language without an IDE, and then move to one later.

Syntax highlighting could occasionally be nice, but I much prefer the raw power associated with a non-WYSIWYG editor. :)  Compliation is as simple as running make (or !! if the target shell ran make most recently).  That's also where ease of maintenance comes in -- with a well configured Makefile, adding new files to a project is as simple as dumping their unadorned names into a macro, from which target macros are derived.  Run gcc -MM on the new files to generate their dependency list, dump that into the Makefile, and you're done.  This last step could be automated with some good Makefile targets too, but I usually don't bother.

I never use paper.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 22, 2004, 03:03 PM
Quote from: Kp on January 22, 2004, 02:48 PM
Quote from: Tuberload on January 22, 2004, 02:38 PM
I use JCreator, which offers syntax coloring (makes it easier for me to work with because I am a visual person), compiles my project for me with the push of a button (laziness perhaps ;D), and helps keep it organized for me. I am not doubting what you are saying because I do see the benefits of not using a IDE. My question is how does it help you to design your projects better not using an IDE? I design all my projects on paper, so I don't see how it would be a burden. The main issue with IDE's to me is all the auto-complete and lookup features. I don't think people really learn when all they have to do is get part of it correct, and the IDE does the rest for them. That's why I learn a language without an IDE, and then move to one later.

Syntax highlighting could occasionally be nice, but I much prefer the raw power associated with a non-WYSIWYG editor. :)  Compliation is as simple as running make (or !! if the target shell ran make most recently).  That's also where ease of maintenance comes in -- with a well configured Makefile, adding new files to a project is as simple as dumping their unadorned names into a macro, from which target macros are derived.  Run gcc -MM on the new files to generate their dependency list, dump that into the Makefile, and you're done.  This last step could be automated with some good Makefile targets too, but I usually don't bother.

I never use paper.

What do you use to design your projects then? I do all of my analysis/design on paper because it is low tech, gets me away from the computer, and I can work on it anyware. Don't you ever write notes down?

Addition: I dont like WYSIWYG editors either because they use their own code, so you do not get to create it yourself.
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 03:15 PM
Quote from: Tuberload on January 22, 2004, 03:03 PMWhat do you use to design your projects then? I do all of my analysis/design on paper because it is low tech, gets me away from the computer, and I can work on it anyware. Don't you ever write notes down?

Addition: I dont like WYSIWYG editors either because they use their own code, so you do not get to create it yourself.

I never take notes on designs, because I've never needed to take notes.  I just know what I want when I sit down.  Most WYSIWYGs can be convinced to let you start from scratch, I think.  Mostly, I like the much more rapid/extensive editing facilities of an editor like vi.  [How many keystrokes does it take you to replace all instances of 'fooXXaa' with 'behXXbb' in just one subroutine out of a much larger file, with the XXs held constant between replacements? ;)  It would take me 23 plus the number of digits involved in describing the line numbers:  :<line1>,<line2>s/foo\(..\)aa/beh\1bb/g<CR>.)

[Edit: made example more elaborate.]
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 22, 2004, 04:01 PM
Quote from: Kp on January 22, 2004, 03:15 PM
Quote from: Tuberload on January 22, 2004, 03:03 PMWhat do you use to design your projects then? I do all of my analysis/design on paper because it is low tech, gets me away from the computer, and I can work on it anyware. Don't you ever write notes down?

Addition: I dont like WYSIWYG editors either because they use their own code, so you do not get to create it yourself.

I never take notes on designs, because I've never needed to take notes.  I just know what I want when I sit down.  Most WYSIWYGs can be convinced to let you start from scratch, I think.  Mostly, I like the much more rapid/extensive editing facilities of an editor like vi.  [How many keystrokes does it take you to replace all instances of 'fooXXaa' with 'behXXbb' in just one subroutine out of a much larger file, with the XXs held constant between replacements? ;)  It would take me 23 plus the number of digits involved in describing the line numbers:  :<line1>,<line2>s/foo\(..\)aa/beh\1bb/g<CR>.)

[Edit: made example more elaborate.]

Well you got me their... After seriously trying to even find a way to do this in JCreator, I failed... I could make a tool to do this an insert it into the tools of the IDE, but that is still more work.

I used to just sit down and work on projects without writing them out on paper first. I then enrolled in a Java class, and my teacher told me that was a horrible, error prone way of doing things so I have since changed my methods. I guess it is a matter of opinion.

Edit (Question): What flavor of Linux do you use? I have been interested in learning to use the operating system for some time now but am yet to attempt it.
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 04:15 PM
Quote from: Tuberload on January 22, 2004, 04:01 PM
Well you got me their... After seriously trying to even find a way to do this in JCreator, I failed... I could make a tool to do this an insert it into the tools of the IDE, but that is still more work.

I used to just sit down and work on projects without writing them out on paper first. I then enrolled in a Java class, and my teacher told me that was a horrible, error prone way of doing things so I have since changed my methods. I guess it is a matter of opinion.

Edit (Question): What flavor of Linux do you use? I have been interested in learning to use the operating system for some time now but am yet to attempt it.

I've had an instructor or two try to tell me that years ago, but it didn't take.  I do plan first, just that I don't write any of it down. :)  I use an antiquated form of Red Hat, which I'm planning on upgrading sometime in the next year or so.  There exist vi ports for Windows if you want to start learning it before you switch, though.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 22, 2004, 04:27 PM
Quote from: Kp on January 22, 2004, 04:15 PM
Quote from: Tuberload on January 22, 2004, 04:01 PM
Well you got me their... After seriously trying to even find a way to do this in JCreator, I failed... I could make a tool to do this an insert it into the tools of the IDE, but that is still more work.

I used to just sit down and work on projects without writing them out on paper first. I then enrolled in a Java class, and my teacher told me that was a horrible, error prone way of doing things so I have since changed my methods. I guess it is a matter of opinion.

Edit (Question): What flavor of Linux do you use? I have been interested in learning to use the operating system for some time now but am yet to attempt it.

I've had an instructor or two try to tell me that years ago, but it didn't take.  I do plan first, just that I don't write any of it down. :)  I use an antiquated form of Red Hat, which I'm planning on upgrading sometime in the next year or so.  There exist vi ports for Windows if you want to start learning it before you switch, though.

I have a copy of Red Hat 7, and Caldera OpenLinux 2.4(sp?). In your opinion what would you recommend? I have read about the differences/similarities and pros/cons of both, but it never hurts to have a professional opinion.

As soon as I finish the first issue of The Bot Creator, I think I will try and install linux.
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 04:45 PM
I've used RedHat 5 series and 6 series, but nothing later than that.  I've not used Caldera at all.  As such, I don't think I can offer you much guidance. :P
Title: Re:Bots in Java - info please!
Post by: iago on January 22, 2004, 05:29 PM
vim DOES have syntax highlighting, and automated indenting.

The #1 reason I use an IDE (netbeans, incidentally) is because of autocompletion.  I have a terrible memory for names (whether it's people's names, function names, etc.), and having a reminder pop up when I sit at '.' for more than a second is handy.

But as far as plain text editors go, vim is by far the best.
Title: Re:Bots in Java - info please!
Post by: Kp on January 22, 2004, 05:46 PM
Quote from: iago on January 22, 2004, 05:29 PM
vim DOES have syntax highlighting, and automated indenting.

I'm using a somewhat old vi clone (not of my own design). I should probably upgrade to a new vim. :P
Title: Re:Bots in Java - info please!
Post by: iago on January 22, 2004, 07:23 PM
On this version of linux (Slackware 9.1), it has syntax highlighting for C/C++, Java, html, and probably some others.  I noticed, however, that vi and vim are both symbolic links to a piece of software called elvis, which has this description:

QuoteNAME
      elvis - a clone of the ex/vi text editor

SYNOPSIS
      elvis  [-V...]   [-a]  [-r] [-R] [-e] [-i] [-S] [-s|-] [-f
      session] [-o logfile] [-G gui] [-c  command|+command]  [-t
      tag] [-w scroll] [-b blksize] [file]...

DESCRIPTION
      elvis  is  a  text  editor.  It is intended to be a modern
      replacement for the classic ex/vi  editor  of  UNIX  fame.
      elvis  supports many new features, including multiple edit
      buffers,  multiple  windows,  multiple   user   interfaces
      (including  an  X11  interface),  and a variety of display
      modes.

      For a more complete description, you  should  see  elvis's
      on-line  documentation.  To view this documentation, start
      elvis and then give the command ":help".

      To exit elvis, you can give the command ":q"  in  each  of
      its  windows.   If you've modified the buffer in a window,
      and you want to abandon those changes, then give the  com-
      mand ":q!" instead.
Title: Re:Bots in Java - info please!
Post by: After-Death on January 23, 2004, 01:40 PM
Quote from: Tuberload on January 22, 2004, 02:16 PM

I am working on a guide to creating Battle.net bots. All examples will be written in Java to start with, so when it is released it may be of some help to you.

Info would be much appreciated.
Title: Re:Bots in Java - info please!
Post by: hismajesty on January 23, 2004, 01:52 PM
Quote from: iago on January 22, 2004, 10:44 AM
C# is similar to Java...

Correct, Microsoft said C# was made up of (I'm doing this from memory so the percents will be a bit off possibly) 60% Java, 15% C++, 10% Visual Basic, and 15% new.
Title: <Humor>
Post by: Kp on January 23, 2004, 03:24 PM
Quote from: hismajesty on January 23, 2004, 01:52 PM
Correct, Microsoft said C# was made up of (I'm doing this from memory so the percents will be a bit off possibly) 60% Java, 15% C++, 10% Visual Basic, and 15% new.

Syntax error: operator new with no associated type.  At least at one time, that syntax error would send VC into a loop until it hit 100 errors (in total), then reported encountering 102 errors. :)
Title: Re:Bots in Java - info please!
Post by: R.a.B.B.i.T on January 23, 2004, 06:15 PM
C# (as described by Newby) is a VB GUI interface editor with C++ code syntax.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 23, 2004, 10:32 PM
Quote from: R.a.B.B.i.T on January 23, 2004, 06:15 PM
C# (as described by Newby) is a VB GUI interface editor with C++ code syntax.

I dont recommend listening to people with the name newby because they are giving you bad descriptions...
Title: Re:Bots in Java - info please!
Post by: R.a.B.B.i.T on January 23, 2004, 10:41 PM
Quote from: Tuberload on January 23, 2004, 10:32 PM
Quote from: R.a.B.B.i.T on January 23, 2004, 06:15 PM
C# (as described by Newby) is a VB GUI interface editor with C++ code syntax.

I dont recommend listening to people with the name newby because they are giving you bad descriptions...

HAH!  His aim name is Newby1337.  He's trying to confuse me!!
Title: Re:Bots in Java - info please!
Post by: Twin_One1 on January 26, 2004, 01:32 PM
Microsoft has J++ which is a visual studio 6.0 thing, J# which is a .NET thing and comes with visual studio 2003 .net.  Then there is C# which is what I perfer, although J# is the same thing as java and has the sun packages (although i'm not sure what version) and it also has the .net packages.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 26, 2004, 01:44 PM
Quote from: Twin_One1 on January 26, 2004, 01:32 PM
Microsoft has J++ which is a visual studio 6.0 thing, J# which is a .NET thing and comes with visual studio 2003 .net.  Then there is C# which is what I perfer, although J# is the same thing as java and has the sun packages (although i'm not sure what version) and it also has the .net packages.

J++/J# is not just like Java, and if you want to use Java I dont recommend using either of the two. I do not remember exact differences, I just remember Microsoft's Java compilers are somewhat of a joke when it comes to Java standards.
Title: Re:Bots in Java - info please!
Post by: Twin_One1 on January 26, 2004, 02:08 PM
You can take Java programs open it up in visual studio .net and compile it and have a working J# program.
Title: Re:Bots in Java - info please!
Post by: Kp on January 26, 2004, 03:44 PM
Quote from: Twin_One1 on January 26, 2004, 02:08 PM
You can take Java programs open it up in visual studio .net and compile it and have a working J# program.

but are you guaranteed that a program which compiles with no warnings/errors in J# will compile on a true to-spec Java compiler?  If the IDE allows Microsoft extensions without warning, you may very easily be writing code that isn't truly Java.
Title: Re:Bots in Java - info please!
Post by: Twin_One1 on January 26, 2004, 07:20 PM
QuoteMicrosoft's newly released Visual J# .Net Beta 1 -- a full clean-room Java implementation -- offers Microsoft Visual J++ (VJ++) developers a migration path to .Net for their VJ++ projects. While J# successfully converts a range of compiled Java code into .Net binaries, its JDK support remains frozen at Java 1.1.4 and the .Net binaries work only on Windows.

http://www.javaworld.com/javaworld/jw-11-2001/jw-1121-iw-jsharp.html
Title: Re:Bots in Java - info please!
Post by: Twin_One1 on January 26, 2004, 07:29 PM
I don't think there are major differences between Java and J# except for the .NET packages and its missing a couple of Sun's packages.

Whoops, I meant to click modify :(
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 27, 2004, 01:30 AM
QuoteMicrosoft's newly released Visual J# .Net Beta 1 -- a full clean-room Java implementation -- offers Microsoft Visual J++ (VJ++) developers a migration path to .Net for their VJ++ projects. While J# successfully converts a range of compiled Java code into .Net binaries, its JDK support remains frozen at Java 1.1.4 and the .Net binaries work only on Windows. (900 words; November 21, 2001)
To me the summary of that article says it all...

Edit: This is just an opinion, but I will never use J# because I see it as just another way for Microsoft to try and control everything.

Edit: Did you even read that article before posting?
Title: Re:Bots in Java - info please!
Post by: Twin_One1 on January 27, 2004, 10:27 AM
I read it a while ago, then I just now went and found it again so I wouldn't be basing my statement on memory.
Title: Re:Bots in Java - info please!
Post by: MyndFyre on January 27, 2004, 10:42 AM
Quote from: Twin_One1 on January 26, 2004, 02:08 PM
You can take Java programs open it up in visual studio .net and compile it and have a working J# program.

Not quite...

IIRC, Microsoft reached the settlement with Sun that they could only distribute Microsoft versions of the JDK up to 1.1.4.  Because of this, you can't directly migrate apps from JDK to J# (for instance, I tried to compile Joscar, and there were about 40 classes missing from support because 1.1.4 is so old).  

While you would like to think that those are the only three languages that gave to C#, here's what I can figure:

RAD support from Visual Basic, along with properties and events (also related to COM and IDL).
Pointer support, operator overloading, and general syntax (such as ; to end a statement) from C/C++.
Class structure from Java.
Structured Exception Handling based on Ada (IIRC).
Value types, enumerations, and delegates are new.
Title: Re:Bots in Java - info please!
Post by: Tuberload on January 27, 2004, 10:43 AM
Quote from: Twin_One1 on January 27, 2004, 10:27 AM
I read it a while ago, then I just now went and found it again so I wouldn't be basing my statement on memory.

Ok, because that whole article basicaly explains why J# is not Java...