Valhalla Legends Forums Archive | .NET Platform | .Net BoT

AuthorMessageTime
Brandon
Does any one know where I can get a tutorial for programming a Visual Basic .NET bot? I can't seem to find any.. I even tried google and asked other programers I know.. Can anyone help me?
April 27, 2004, 1:22 AM
Myndfyr
[quote author=Brandon link=board=37;threadid=6497;start=0#msg57059 date=1083028956]
Does any one know where I can get a tutorial for programming a Visual Basic .NET bot? I can't seem to find any.. I even tried google and asked other programers I know.. Can anyone help me?
[/quote]

Visual Basic .NET is new, and I do not believe that anyone has created a bot in that specific language to date. I have put one together (there's some controversy as to whether mine or DarkFeanor's was the first in C#), but the library that mine uses is well-encapsulated and should greatly speed your development process.

My library is probably ready-to-go for you right now, as far as the types go. I will re-publish the documentation and give you some information about how it should be put together (I will try putting one together in VB .NET first, just to be sure it will work). I have not worked at all on getting the Starcraft connections or anything else in there -- right now it only works with Warcraft III and The Frozen Throne. The update for connecting to Brood War and the older games (incl. Diablo) will be completely compatible with what I have currently, as long as you implement certain interfaces (such as IConnectionSettings) properly.

Here's how it works:

You are required to validate a key to my server before you can use the bot. This may be done by hooking some events (sorry, this is C# -- I hope you can translate):

[code]
// elsewhere defined:
public delegate void ErrorEventHandler(string message, bool disconnected, Exception cause);

public void RegisterConnection(string key)
{
// Connections is a static class
Connections.KeyValidated += new EventHandler(this.KeyValidated);
Connections.KeyNotValidated += new ErrorEventHandler(this.KeyNotValidated);
Connections.ValidateKey(key);
}

public void KeyValidated(object sender, EventArgs e)
{
// I implement several interfaces, including IConnectionSettings, in a class called
// ConnectionProfile. I have an instance in my main connection manager of this
// called profile.
// this.connectionManager is an instance of IConnectionManager.
this.connectionManager = Connections.GetManager(profile);
}

// The IConnectionManager interface defines several properties including EventHost,
// which returns an IEventHost instance. The IEventHost interface is defined:

public interface IEventHost
{
void RegisterEvent(EventType type, MulticastDelegate handler);
void UnregisterEvent(EventType type, MulticastDelegate handler);
}
[/code]

I'll have more info for you later.
April 27, 2004, 3:53 PM
dRAgoN
[quote]Visual Basic .NET is new, and I do not believe that anyone has created a bot in that specific language to date.[/quote]
I beleve Andreas Strobl has dibs on the first vb.net bot along with one I scraped during one of my what to do Phases back in May last year.
April 27, 2004, 6:31 PM
Brandon
Lol Thanks, I can't translate.. But I can ask some of my friends see if they can help me. But it will still probably help (but they are impatiant with my newbness). Thanks a bunch.
[quote]I will try putting one together in VB .NET first, just to be sure it will work[/quote]
Thanks a lot that would be extremely helpful if you would do that. Cause then I could understand it! ;D
April 27, 2004, 9:38 PM
peofeoknight
Look at some vb6 bots, it would be a fairly similar would it not? I use .net for asp.net, not for application programming, so I do not know how it would differ from using winsock with vb6 though. I know in vb.net with asp.net to use sockets, you request system.net.sockets, is that how it works in vb.net applications too myndfyre?
April 27, 2004, 10:07 PM
Myndfyr
[quote author=dRAgoN link=board=37;threadid=6497;start=0#msg57111 date=1083090684]
[quote]Visual Basic .NET is new, and I do not believe that anyone has created a bot in that specific language to date.[/quote]
I beleve Andreas Strobl has dibs on the first vb.net bot along with one I scraped during one of my what to do Phases back in May last year.
[/quote]

1.) Was the VB .NET bot a binary or CHAT bot?
2.) Was the VB .NET bot a clean rewrite or a port of a VB6 bot?
3.) Was your bot binary or CHAT?

To clarify, my bot was a completely clean write in C#, using a binary connection via BNLS. It made the first successful connection to Battle.net as Starcraft (STAR) in August 2003. The goals driving the project are extensibility, good OOP practices, and efficiency.

ArmaBot is extensible in these ways:

1.) It uses reflection and type loading to allow third-party developers to create custom database backing. In the assembly ArmaBot.Data.dll, it specifies several data-centric interfaces which the assembly must consume, the primary being ArmaBot.Data.IDbProvider.
2.) It uses reflection and type loading to allow third-party developers to create custom plugins that can be applied separately to each connection (This will be implemented in the next alpha version -- which may actually end up being the first beta version). The configuration file automatically accomodates this.
3.) It allows developers who want to create a bot (see above) to easily set up their own consumption of the API.

As for Brandon, I recommend learning the .NET Framework Class Library. Compare the syntax of VB .NET and C# in the help files. They're very similar in nature, and you should be able to get them together.

Cheers.
April 27, 2004, 10:09 PM
Brandon
[quote]Learn the language before making a bot. As always, good advice.[/quote]
I will just keep learning the language, cause I dont' want to over do it. And I feel as if I am wasting your time with my questions right now. So I will just ask for the location of some tutorials for vb projects with an open source and I can always ask for codding tips here right?
April 27, 2004, 11:12 PM
Myndfyr
[quote author=Brandon link=board=37;threadid=6497;start=0#msg57165 date=1083107552]
[quote]Learn the language before making a bot. As always, good advice.[/quote]
I will just keep learning the language, cause I dont' want to over do it. And I feel as if I am wasting your time with my questions right now. So I will just ask for the location of some tutorials for vb projects with an open source and I can always ask for codding tips here right?
[/quote]

Well, you're not wasting my time as much as you are your own. As I've said before, I had about a year of experience with C# and .NET before undertaking the making of a bot. You will find that when you understand the concepts within programming, things are easier to do.

I highly recommend www.gotdotnet.com as a major place for learning. The user samples and the message boards are a fantastic resource with many, many knowlegeable people; there are, however, just as many ignorant people. Don't take one user's response as law.

Yes, you can most certainly ask for coding tips here. As you've run across iago's post on the /WHOAMI forum, just keep things on-topic. You'll find we try to be helpful. :)
April 27, 2004, 11:29 PM
Brandon
Okay I have one question that has been bothering me forever. What exactly is a string? I dont' really understand those. Do you?
April 27, 2004, 11:42 PM
St0rm.iD
Strings are sequences of characters in quotes. This message is a string, for instance. Things that aren't strings are numbers (integers, floats (decimals)), booleans (true false), and complex types (classes, structs, and the like).
April 28, 2004, 12:42 AM
Myndfyr
It's worthwhile to note that when strings are transmitted over a network protocol, they typically don't send the quotes.
April 28, 2004, 1:07 AM
kamakazie
[quote author=Myndfyre link=board=37;threadid=6497;start=0#msg57203 date=1083114428]
It's worthwhile to note that when strings are transmitted over a network protocol, they typically don't send the quotes.
[/quote]

[quote]
1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by AT&T."
1018 INFO "There are currently 829 users in Chat, and 157498 users playing 61614 games on Battle.net."
[/quote]
April 28, 2004, 3:28 AM
peofeoknight
I think the key word was typically :-X. I did not get a response to my post before, but vb.net applications would use system.net.sockets just as it is used when doing asp.net with vb.net correct?
April 28, 2004, 3:47 AM
Myndfyr
[quote author=dxoigmn link=board=37;threadid=6497;start=0#msg57221 date=1083122932]
[quote author=Myndfyre link=board=37;threadid=6497;start=0#msg57203 date=1083114428]
It's worthwhile to note that when strings are transmitted over a network protocol, they typically don't send the quotes.
[/quote]

[quote]
1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by AT&T."
1018 INFO "There are currently 829 users in Chat, and 157498 users playing 61614 games on Battle.net."
[/quote]
[/quote]

Of course Mr. Smart Guy, the quotes are part of the string, not the enclosing delimiters of the string itself.

A string is an arbitrary sequence of bytes or words (in the case of Unicode strings). These are typicially delimited by quotes, but not necessarily:

From YaBB 1.3.1 Display.pl:
[code]
   print FILE qq~$tmpa|$tmpb~;
[/code]

In this case, the string is delimited by the tilde (~) character.

Programmatically, strings are maintained (since they are of arbitrary length) in memory either by the runtime remembering how long a specific string is (as is the case in .NET), or by using a specific byte value not typically seen in normal usage. For example, C-based languages (excluding C# and Java) use the NULL (0) byte to indicate where a string ends:

The C string "12345" is (in hex):
[code]
31 32 33 34 35 00
[/code]

The null terminator byte isn't a given; in my Assembler class, we used a couple different terminators. A common one was the byte value 13:

[code]
TERMINATOR equ 13
str db "12345",TERMINATOR
[/code]

Hope that clarifies things. :)
April 28, 2004, 4:33 AM
AnonProgrammer
Thanks for the links to the code postings. I derived much enjoyment from reading them.

So much to do, so little time…
April 28, 2004, 5:03 AM
kamakazie
[quote author=Myndfyre link=board=37;threadid=6497;start=0#msg57230 date=1083126790]
Of course Mr. Smart Guy, the quotes are part of the string, not the enclosing delimiters of the string itself.
[/quote]

I thought the quotes in my example *are* the enclosing delimiters of the string?
April 28, 2004, 6:32 AM
dRAgoN
[quote author=Myndfyre link=board=37;threadid=6497;start=0#msg57149 date=1083103751]
[quote author=dRAgoN link=board=37;threadid=6497;start=0#msg57111 date=1083090684]
[quote]Visual Basic .NET is new, and I do not believe that anyone has created a bot in that specific language to date.[/quote]
I beleve Andreas Strobl has dibs on the first vb.net bot along with one I scraped during one of my what to do Phases back in May last year.
[/quote]

1.) Was the VB .NET bot a binary or CHAT bot?
2.) Was the VB .NET bot a clean rewrite or a port of a VB6 bot?
3.) Was your bot binary or CHAT?

[/quote]
My VB .Net bot was a clean project, and was a bbot that connected as d2xp useing a horibly slow local hashing system. It's first successful connection was on May 10 2003. I probably wouldent have scraped it either if I didn't have a total system failure 2days after the central/east-coast black out. Just means its back on my todo sometime later list again.
April 28, 2004, 2:01 PM
Smurfling
[quote author=Myndfyre link=board=37;threadid=6497;start=0#msg57149 date=1083103751]
[quote author=dRAgoN link=board=37;threadid=6497;start=0#msg57111 date=1083090684]
[quote]Visual Basic .NET is new, and I do not believe that anyone has created a bot in that specific language to date.[/quote]
I beleve Andreas Strobl has dibs on the first vb.net bot along with one I scraped during one of my what to do Phases back in May last year.
[/quote]
1.) Was the VB .NET bot a binary or CHAT bot?
2.) Was the VB .NET bot a clean rewrite or a port of a VB6 bot?
3.) Was your bot binary or CHAT?
[/quote]

1 - Binary Bot (bw game bot)
2 - Clean rewrite - well at least at later revisions :P. First version was using csb and a winsock ocx. After some more practice and experience i rewrote the socket part the .net way (no ocx, just system.net.sockets) and then did my own packet coding without csb. When i wrote eXgBot i just changed from vs6 to 7. Right now having a look at vs8 ctp. Btw, anyone already looked through it? Just received it so can't tell yet, all i seen yet (and do pretty much appreciate) are the much more efficient objects and machine-level components.

Edited: .net isn't that new anyway ;)
June 26, 2004, 2:39 PM
Antichrist
[quote author=dRAgoN link=board=37;threadid=6497;start=0#msg57111 date=1083090684]
I beleve Andreas Strobl has dibs on the first vb.net bot along with one I scraped during one of my what to do Phases back in May last year.
[/quote]

:( I wanted to be the 1st vb.net bot, but then again, I'm a newbie so by the time I get a bot up there will be an abundence of vb.net bots out there.
August 17, 2004, 2:28 AM

Search