• Welcome to Valhalla Legends Archive.
 

a type of bnet bot no one's mentioned (AFAIK)

Started by MrMachineCode, October 24, 2003, 01:40 PM

Previous topic - Next topic

MrMachineCode

You might remember from my other posting I'm looking to make a bnet bot that will connect my AI program to battlenet.  AI is my forte; I have no experience with socket or network programming, and it is only because I work as a network administrator that I have a vague understanding of the discussions about packets and packet logging for the binary interface.  (Because I work with network hardware, not network programming.)  Furthermore, I'm just lazy, ok?  I don't want to have to learn to work with packets when I'm still busy programming my AI.

I still need a way to connect my AI program to bnet, but I am not so brazen as to ask someone to give me that solution on a silver platter.  But, wait, I already have that solution on a silver platter.

Why should I try to make a program to connect to the bnet binary interface, when blizzard has already made a dozen programs FOR me that do it?

I'm talking, of course, about the games themselves.  For instance, I have Diablo 1, which is all I'm actually interested in connecting as anyway. WHY NOT USE THE DIABLO 1 EXE ITSELF AS MY AI'S CHAT CLIENT???

Madness you say?  Not at all.  Diablo has to call certain Windows functions to get it's user input from the keyboard and mouse, and it has to call other functions to display text.  If I hack my keyboard and video drivers, load a wedge between the drivers and the diablo.exe that can send data from my AI to Diablo so that Diablo thinks it's coming from the keyboard, and can intercept Diablo sending chat text to the screen, I can use diablo.exe like a massive, bloated, clunky chat interface.

Windows provides a function called *system hooks* that lets you do things like this.  It's how key-loggers work and how some drivers probably work.

For those of you who have some experience programming packet interfaces, hacking the keyboard and video drivers might well be more work than it's worth.  On the other hand, I have some small experience doing stuff like this, and none at all with packet programming.  I think that for me, it would be easier to make this bizarre contraption.

And don't forget there is one advantage--Blizzard could NEVER plug this hole without banning their own games!

Edit:  Uh, that is to say, I have written video drivers and keyboard drivers for DOS games.  Which is not quite the same thing as doing it for windows.  Still, I'm sure I can do it.

K

QuoteAnd don't forget there is one advantage--Blizzard could NEVER plug this hole without banning their own games!

Well, they already kinda have.  Diablo I is restricted to public channels.  If you only want to have your bot in public channels, why not just use the chat gateway? There are loads of examples on how to connect to it and parse it.
Plus you wouldn't have to deal with the bloated diablo interface  ;)

MrMachineCode

Hrmmm.... I was under the impression that the telnet chat interface was 100%, totally banned from all bnet channels.  When I tried TopazChat I couldn't join diablo 1 channels (or any others, for that matter), it said I was restricted.  If it's only because Topaz chat is crap, and if I could get to diablo 1 channels with a telnet interface, that would be welcome news indeed.

K

The telnet interface can join open channels, like "public chat (x)", "open tech support", "blizzard chat (x)".  Diablo I can join these channels plus Diablo I specific channels.  If you want to get into Diablo I channels, then emulating / hooking Diablo would be the answer.

PS - What language is your AI program written in? I'm sure someone could provide you with a connection somehow, either with source code that you could merge or via a plugin interface.

Skywing

#4
The idea of hijacking the game process or using the game through a proxy type program to connect to Battle.net isn't new.  There are a number of very significant disadvantages to doing this:

1) Automatic reconnection is mostly unfeasible.
2) Many of the Blizzard game clients run a tight loop with no wait states while in the Battle.net chat screen.  This impacts the performance of the rest of the system.
3) Many of the Blizzard game clients have a very large memory footprint, even when in the Battle.net chat screen.
4) At least two Battle.net-enabled Blizzard games are prone to crashing if left in a Battle.net chat channel.
5) At least two Battle.net-enabled Blizzard games contain authentication routines that make the use of a proxy type program that does not modify code in the game process unfeasible.

MrMachineCode

My AI is in C++.  I am rewriting it from scratch, to incorporate new ideas and put it in a DLL, but that will also be in C++.

It's the Diablo USA-x channels and the Diablo <some clan> channels I want to be able to access, but maybe open tech support could be fun to put it in instead.

Good points, Skywing; since I have an old computer, the memory and speed issues would indeed be a problem.  Furthermore, Diablo 1 does indeed crash in chat after a few hours, and this would be a bit of an annoyance as what I want to do is to be able to leave my AI in a channel for DAYS so that it will learn as much as possible.

OTOH, if I were to develop such a program as could hook the user interface like this, I can think of a lot of fun things I could do with something like that.  If I had one that was general enough I'd be able to interface it to many different programs.

Kp

Quote from: MrMachineCode on October 24, 2003, 01:40 PM
For those of you who have some experience programming packet interfaces, hacking the keyboard and video drivers might well be more work than it's worth.  On the other hand, I have some small experience doing stuff like this, and none at all with packet programming.  I think that for me, it would be easier to make this bizarre contraption.
Even in light of your admitted inexperience with the bnbinary interface, I think it'd be much easier for you to develop a separate binary client that emulates Diablo than to try to hack Diablo itself.  The binary interface is IMO not that hard with a decent tutorial and some basic programming experience, and definitely outweighs the problems (as Skywing outlined).

Quote from: K on October 24, 2003, 02:05 PM
The telnet interface can join open channels, like "public chat (x)", "open tech support", "blizzard chat (x)".  Diablo I can join these channels plus Diablo I specific channels.
Minor correction:  Diablo clients cannot enter "Public Chat *"or  "Blizzard Chat *".  They can enter Diablo *, the Diablo-related channels, Open Tech Support, and Blizzard Tech Support.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Tuberload

#7
I think the idea of incorporating your AI into previously built bots that have plug-in support would be the best idea. You could just create a wrapper for your AI API that would allow for it to plug-in to any bot you would like.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Arta

I agree with Kp. You are obviously a competent programmer - learning to use sockets and coding a basic Battle.net client shouldn't pose a significant challenge, especially with things like BnetDocs to help you.

I like this AI idea - I'm willing to help if you need a hand. You can grab my MSN address from anyone who knows me or find me in channel if you wish.

Michael


iago

This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Grok

Quote from: iago on November 01, 2003, 04:28 PM
Good luck writing a good ai in VB :P

Why is that a problem?  Or why can he not call his AI from VB?

iago

Quote from: Grok on November 01, 2003, 04:39 PM
Quote from: iago on November 01, 2003, 04:28 PM
Good luck writing a good ai in VB :P

Why is that a problem?  Or why can he not call his AI from VB?

True, he could make a call to it.

But a lot of the concepts we've used in AI would be fairly difficult to port to vb.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: iago on November 01, 2003, 04:49 PM
But a lot of the concepts we've used in AI would be fairly difficult to port to vb.

Such as?

Michael

This may be a little off topic but could you create a AI with VB?