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?
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=2244;start=0 (http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=2244;start=0)
http://forum.valhallalegends.com/phpbbs/index.phph?board=17;action=search (http://forum.valhallalegends.com/phpbbs/index.phph?board=17;action=search)
Well im not sure abouit PHP, but it could definatly be done in Flash, or ActiveX.
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
You can make a bot in flash!?
Quote from: CrAz3D on August 24, 2003, 04:50 PM
You can make a bot in flash!?
Possibly with CSB? Hehe.
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
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.
Quote from: CrAz3D on August 24, 2003, 04:54 PM
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
Eh? I thought you could use ActiveX controls in flash? If not, one could write an eww++ ISAPI interface...]
I'm pretty sure that you can use ActiveX in Flash, but still, wouldn't this take more effort than VS programming?
What about writing the bot in Flash? Or can Flash only connect "http sockets"?
Quote from: Adron on August 24, 2003, 05:59 PM
What about writing the bot in Flash? Or can Flash only connect "http sockets"?
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.
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
anyone have any suggestions?
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.
thx alot :) i will start to work on that
wut type of socket would i use to connect to battle.net?
socket_connect(AF_INET, useast.battle.net, 0)
I tried that one but i don't think it worked...
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.
ok thx i will put another forum here if i need help lol :)
Does php have functions suited for processing binary data? Or will it mostly be a hack?
Quote from: Camel on August 24, 2003, 06:11 PM
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.
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.
Quote from: Adron on August 25, 2003, 02:42 PM
Does php have functions suited for processing binary data? Or will it mostly be a hack?
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 (http://www.php.net/strings)
[edit] Even better, check out pack() (http://www.php.net/pack).
I suppose, assuming that it can handle strings with the full range of char codes (especially \0) in them.
Quote from: Adron on August 25, 2003, 03:12 PM
I suppose, assuming that it can handle strings with the full range of char codes (especially \0) in them.
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 from: Camel on August 25, 2003, 03:23 PM
The only thing it can't do is output \0 to the browser.
[edit] Well, it can *do* it, but...well, try it yourself.
Hmm, I have absolutely no experience with php. So, enlighten me, what happens? :)
At least in my experience, the output is treated as a null terminated string. The rest of the document just stops.
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...
Bnet uses a tcp socket.
$csb = new Com('CleanSlateBotClassNameWhateverItIs');
lol, does that actually work when php is running under IIS? I have a feeling it won't work very well under linux/Apache...
Won't work on Apache...that's why I don't recommend it, but it looks like this guy doesn't feel like thinking.
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?
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
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.
would this php command work to connect to bnet?
<?
$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;
?>
how owuld i get php to decode and tell bnet wut client im using whne i connect thorugh a socket?
Quote from: UnderCover on August 26, 2003, 09:02 PM
...
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (!$socket == false) {
echo "Socket Was Not Created";
} ...
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...
ohh wut code owuld you recommend?
Just remove the "== false" part?
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
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.
Quote from: St0rm.iD on August 27, 2003, 03:25 PM
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
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.
Ah, I didn't know there was a PHP-ISAPI module. Last time I adminned Windows IIS, I had to run PHP as CGI.