Valhalla Legends Forums Archive | Battle.net Bot Development | Possibility Putting A Bot On A Website

AuthorMessageTime
UnderCover
I was wondering if there was a way to maybe use PHP to put a bot on a website and let it connect through a website and you can interact with it so you don't have to download anything?
August 24, 2003, 12:16 PM
CrAz3D
https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=2244;start=0
https://davnit.net/bnet/vL/phpbbs/index.phph?board=17;action=search
August 24, 2003, 4:49 PM
13inary
Well im not sure abouit PHP, but it could definatly be done in Flash, or ActiveX.
August 24, 2003, 9:39 PM
UnderCover
if you would make one thorugh activex or something how would you ocnnect to bnet and get responses like i know if you use sockets php cna handle sockets and etc But im not sure how to connect thorugh them and then get resposnes form the server
August 24, 2003, 9:42 PM
CrAz3D
You can make a bot in flash!?
August 24, 2003, 9:50 PM
Camel
[quote author=CrAz3D link=board=17;threadid=2437;start=0#msg19067 date=1061761857]
You can make a bot in flash!?
[/quote]

Possibly with CSB? Hehe.
August 24, 2003, 9:52 PM
CrAz3D
I'd think that'd be a little hard to do, we are talking about the same flash here 13inary aren't we?

Macromedia Flash
August 24, 2003, 9:54 PM
St0rm.iD
Yes, I'd say it's possible to create a bot in PHP (in fact I tried once when I was a php newb).

You'll have to look into the php socket and file functions. The catch here is keeping the socket open between page requests. My best guess would try to store in in a session variable, although I doubt you can serialize a socket.

The way I would go about it (which probably isn't the way you'll do it) is I'd set up an RPC-sort of server which is connected to Battle.net. I'd have PHP talk to that every time a page is requested.

Good luck.
August 24, 2003, 10:01 PM
Camel
[quote author=CrAz3D link=board=17;threadid=2437;start=0#msg19069 date=1061762063]
I'd think that'd be a little hard to do, we are talking about the same flash here 13inary aren't we?

Macromedia Flash
[/quote]

Eh? I thought you could use ActiveX controls in flash? If not, one could write an eww++ ISAPI interface...]
August 24, 2003, 10:03 PM
CrAz3D
I'm pretty sure that you can use ActiveX in Flash, but still, wouldn't this take more effort than VS programming?
August 24, 2003, 10:41 PM
Adron
What about writing the bot in Flash? Or can Flash only connect "http sockets"?
August 24, 2003, 10:59 PM
Camel
[quote author=Adron link=board=17;threadid=2437;start=0#msg19086 date=1061765948]
What about writing the bot in Flash? Or can Flash only connect "http sockets"?
[/quote]

Well if it doesnt, one could use the Winsock control. Even then, I seriously doubt that flash would be able to perform a checksum, decode a cd key, or hash anything.
August 24, 2003, 11:11 PM
UnderCover
so if i used php how would i ge tit to send infomation to bnet and wut socket would i connect too like i would have to deocde a cd key would i exe a check revision file or something
August 24, 2003, 11:13 PM
UnderCover
anyone have any suggestions?
August 25, 2003, 3:59 PM
St0rm.iD
Ugh, I already fucking told you everything you need to know.

1. READ THE DOCUMENTATION ON THE SOCKET API. IT ISN'T ALL THAT HARD TO TYPE www.php.net/socket

2. Decide on persistant connections or not, persistant being defined as whether you will initiate a new connection every time the page is loaded. For you, you probably will.

3. Port BNLS to PHP...or if you're lazy and hosting on windows, new Com('CSB'). Perhaps someone has ported it to Java, so you can use the Java->PHP connector stuff to use it. You really want to use BNLS, as hashing in PHP would be...how you say..."ewww."

4. Start with connecting as chat.

If you noticed, I was the only one in this thread who actually gave a workable solution. If you'd pay attention and READ MY POSTS, you might be able to make it.

That is all.
August 25, 2003, 4:07 PM
UnderCover
thx alot :) i will start to work on that
August 25, 2003, 4:52 PM
UnderCover
wut type of socket would i use to connect to battle.net?

[code]

socket_connect(AF_INET, useast.battle.net, 0)

[/code]

I tried that one but i don't think it worked...
August 25, 2003, 7:02 PM
Camel
Well, you could start by putting quotes around useast.battle.net.
Additionally, you'll need to connect on port 6112, not port 0.

PHP could not possibly be documented more thoroughly.
August 25, 2003, 7:12 PM
UnderCover
ok thx i will put another forum here if i need help lol :)
August 25, 2003, 7:33 PM
Adron
Does php have functions suited for processing binary data? Or will it mostly be a hack?
August 25, 2003, 7:42 PM
Adron
[quote author=Camel link=board=17;threadid=2437;start=0#msg19087 date=1061766670]
Well if it doesnt, one could use the Winsock control. Even then, I seriously doubt that flash would be able to perform a checksum, decode a cd key, or hash anything.
[/quote]

If you're using controls, why not use csb?

I'm pretty sure Flash could perform checksums, decode cd keys and hash things. Mathematical algorithms shouldn't be a problem, I recall the engine being rather capable.

What I don't know is how to solve the communications with the outside world, and converting binary data to data that Flash can understand.

August 25, 2003, 7:44 PM
Camel
[quote author=Adron link=board=17;threadid=2437;start=15#msg19158 date=1061840567]
Does php have functions suited for processing binary data? Or will it mostly be a hack?
[/quote]

At the very least it has chr() and ord() which are enough to at least get going on "number"<-->"string" conversion.
www.php.net/strings

[edit] Even better, check out pack().
August 25, 2003, 8:10 PM
Adron
I suppose, assuming that it can handle strings with the full range of char codes (especially \0) in them.
August 25, 2003, 8:12 PM
Camel
[quote author=Adron link=board=17;threadid=2437;start=15#msg19167 date=1061842351]
I suppose, assuming that it can handle strings with the full range of char codes (especially \0) in them.
[/quote]

The only thing it can't do is output \0 to the browser.

[edit] Well, it can *do* it, but...well, try it yourself.
August 25, 2003, 8:23 PM
Adron
[quote author=Camel link=board=17;threadid=2437;start=15#msg19168 date=1061843032]
The only thing it can't do is output \0 to the browser.

[edit] Well, it can *do* it, but...well, try it yourself.
[/quote]

Hmm, I have absolutely no experience with php. So, enlighten me, what happens? :)
August 25, 2003, 8:31 PM
Camel
At least in my experience, the output is treated as a null terminated string. The rest of the document just stops.
August 25, 2003, 8:34 PM
UnderCover
so wut type of socket would bnet run on i see theres so many diff types of sockets to use im not sure whcich one...
August 25, 2003, 8:42 PM
Adron
Bnet uses a tcp socket.
August 25, 2003, 9:58 PM
St0rm.iD
[code]
$csb = new Com('CleanSlateBotClassNameWhateverItIs');
[/code]
August 25, 2003, 10:12 PM
Adron
lol, does that actually work when php is running under IIS? I have a feeling it won't work very well under linux/Apache...
August 25, 2003, 10:21 PM
St0rm.iD
Won't work on Apache...that's why I don't recommend it, but it looks like this guy doesn't feel like thinking.
August 25, 2003, 10:38 PM
Camel
Last time I used IIS it was still rather buggy and, in general, eww. I've been a dedicated Apache fan ever since -- mostly because at the time I had to host on my linux box, and I was too lazy to recreate all of the different virtual sites when I moved back to windows. Anyways, are there any reasons I should be using IIS rather than Apache?
August 26, 2003, 6:50 AM
UnderCover
Ive been using Apache on my dedicated server from the start...

One reason I use it is because I found a french program that easily setups PHP for me and MySql. Its easy to use and its in English! lol

Another Reason I don't use IIS is im not sure how it works :(

Doesn Anyone have any GOOD reasons why or why not to use IIS
August 26, 2003, 11:58 AM
Adron
Use IIS if you have a Windows server that you want to run it on.

Use IIS if you want to integrate with existing Windows-based services (say Active Directory, or using accounts from a Windows domain to authenticate users).

Use Apache if you have a non-Windows server that you want to run it on.

Use Apache if you can't accept the cost of a Windows server. (Notably high licensing cost for authenticating users)

Use whichever server can run any particular server-side application you want to run.



August 26, 2003, 3:33 PM
UnderCover
would this php command work to connect to bnet?

[code]

<?

$ip = "useast.battle.net";
$port = "6112";

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);


if (!$socket == false) {
   echo "Socket Was Not Created";
} else {
socket_connect($socket, $ip, $port);

if (!socket_connect($socket, $ip, $port)) {
socket_close($socket);
die("Sock_Error: Socket was unable to Connect.\n");
}
}
echo $msg;


?>

[/code]
August 27, 2003, 2:02 AM
UnderCover
how owuld i get php to decode and tell bnet wut client im using whne i connect thorugh a socket?
August 27, 2003, 4:45 AM
Camel
[quote author=UnderCover link=board=17;threadid=2437;start=30#msg19275 date=1061949725]
[code]...
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (!$socket == false) {
   echo "Socket Was Not Created";
} ...[/code]
[/quote]

If the boolean not of the return value is false, wouldn't that indicate success? The only way to get !<value> to be true is to have <value> set to zero, which wouldn't be a very useful socket...
August 27, 2003, 7:19 AM
UnderCover
ohh wut code owuld you recommend?
August 27, 2003, 4:15 PM
Adron
Just remove the "== false" part?
August 27, 2003, 7:27 PM
St0rm.iD
Here is my comparison of Apache and IIS (disclaimer: this is about as unbiased as my VB and Java posts)

- IIS threading vs Apache forking, threading is superior thus higher performance

- Apache runs most everywhere, while IIS on windows. Unix OS's are generally more stable and faster and run on a more variety of hardware.

- Apache is mostly command-line, while IIS is gui. Command line is a good thing, because it's incredibly easy to make tons of changes across multiple remote servers compared to GUI.

- IIS 6 runs a module in kernel mode which is flamboyantly gay. Performance my ass.

- IIS 6 has ASP.net which owns every other serverside language out there hands down. IIS also has PHP but it runs as CGI so it kinda sucks.

- Apache has PHP which is pretty easy but doesn't work for large projects. JSP/Servlets are really cool...but don't try to set up an app server without a lot of coffee and liquor.

Overall...in a perfect world:
- Use Apache on FreeBSD to be your gateway to the world. Serve all your static files from here.

- Set Apache to proxy ASPX/windows EXE requests to your IIS server behind the firewall.

- Set Apache to proxy your scripting stuff to a Linux box behind the firewall. Linux supports the most scripting languages.

- Set all your database stuff to use Postgres on a FreeBSD or linux box.

My 2cents
August 27, 2003, 8:25 PM
Adron
The threading vs forking question is true on Win32, but on another OS it might be very different. Win32 is just not optimized for forking. Forking makes it more stable - a fault in a thread might kill the whole process since it shares memory.

Apache is command line yes, but most of the configuration is done in files anyway. IIS configuration is done in a metabase that you can modify through scripting. In most cases when you modify an apache file, you'll do that too by shell scripting. They seem equal there to me.

IIS6 runs a module in kernel mode which should improve performance. Much like linux has a kernel mode nfs server for better performance than the user mode one. The trade-off is that a bug will blue screen your IIS server instead of just killing an apache process. One is rather fatal and the other won't impact the server much at all.

August 27, 2003, 10:26 PM
Skywing
[quote author=St0rm.iD link=board=17;threadid=2437;start=30#msg19327 date=1062015926]
Here is my comparison of Apache and IIS (disclaimer: this is about as unbiased as my VB and Java posts)

- IIS threading vs Apache forking, threading is superior thus higher performance

- Apache runs most everywhere, while IIS on windows. Unix OS's are generally more stable and faster and run on a more variety of hardware.

- Apache is mostly command-line, while IIS is gui. Command line is a good thing, because it's incredibly easy to make tons of changes across multiple remote servers compared to GUI.

- IIS 6 runs a module in kernel mode which is flamboyantly gay. Performance my ass.

- IIS 6 has ASP.net which owns every other serverside language out there hands down. IIS also has PHP but it runs as CGI so it kinda sucks.

- Apache has PHP which is pretty easy but doesn't work for large projects. JSP/Servlets are really cool...but don't try to set up an app server without a lot of coffee and liquor.

Overall...in a perfect world:
- Use Apache on FreeBSD to be your gateway to the world. Serve all your static files from here.

- Set Apache to proxy ASPX/windows EXE requests to your IIS server behind the firewall.

- Set Apache to proxy your scripting stuff to a Linux box behind the firewall. Linux supports the most scripting languages.

- Set all your database stuff to use Postgres on a FreeBSD or linux box.

My 2cents
[/quote]
Actually, we use IIS with PHP-ISAPI and it works (mostly) fine. Occasionally a bug will crop up that is solved by restarting a dllhost instance, but that doesn't really happen often at all. Much better than running it as a CGI, regardless.
August 27, 2003, 11:00 PM
St0rm.iD
Ah, I didn't know there was a PHP-ISAPI module. Last time I adminned Windows IIS, I had to run PHP as CGI.
August 29, 2003, 3:25 PM

Search