Valhalla Legends Archive

Programming => Web Development => Topic started by: AC_Drkan on May 23, 2005, 05:44 PM

Title: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 23, 2005, 05:44 PM
Hey i found somethig rather interesting.

http://us4.php.net/manual/en/function.system.php

and

http://us3.php.net/manual/en/features.commandline.php

With these 2, if im not mistaken, you can execute php with your own ini file, so therefore, you could setup your own ini file and have the max_execution time set to 0 to allow it to execute indefinately?

This question was dealing with the PHP Bot for battle.net
Title: Re: [PHP] Bringing Back the Bot
Post by: Banana fanna fo fanna on May 23, 2005, 06:55 PM
But if the bot runs forever, the PHP won't ever return anything and will (probably) time out via Apache (though I'm not sure)
Title: Re: [PHP] Bringing Back the Bot
Post by: Warrior on May 23, 2005, 07:51 PM
Those functions are pretty cool, try it
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 23, 2005, 08:20 PM
Will do. Im developing it as i post this. Will bne posting code for all you Source Pirates
Title: Re: [PHP] Bringing Back the Bot
Post by: MyndFyre on May 23, 2005, 08:57 PM
Quote from: AC_Drkan on May 23, 2005, 08:20 PM
Will bne posting code for all you Source Pirates
*squeaky nerdy voice* th4nk j0o soo much mr. drkan!1!11!eleven!!  Now I can m4k3 my 0wn l33t b0t!!1!!1!
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 23, 2005, 09:01 PM
Quote from: MyndFyre on May 23, 2005, 08:57 PM
Quote from: AC_Drkan on May 23, 2005, 08:20 PM
Will bne posting code for all you Source Pirates
*squeaky nerdy voice* th4nk j0o soo much mr. drkan!1!11!eleven!!  Now I can m4k3 my 0wn l33t b0t!!1!!1!
lmao....

Ok, i have a little problem, here it is:
The server i will be running this will have Linux.
The development platfoirm is Windows XP Pro

The include paths are dofferent correct?
Windows: include_path = ".;C:\apache2triad\php;C:\apache2triad\php\smarty;C:\apache2triad\php\pear"
So what would it be in Linux?

I have SSH access on the server so im able to view directories.

Or can i just take the line out?

Nvm...Figured it out with my ub3r l337 ski11z
Linux Include Path: /usr/local/apache

Another edit:
Cannot find the php.ini in that directory, is ther like, a search command in Linux?
Search php.ini produced nothing and said the command did not exsist

GOD I LOVE GOOGLE!
!!!HIDDEN!!!:~ > whereis php.ini
php: /usr/local/bin/php4.old
/usr/local/bin/php4.20030910
/usr/local/bin/php
/usr/local/lib/php3.ini
/usr/local/lib/php
/usr/local/lib/php.ini


So if i make this....Can someone make the connection code to log onto BNET with a Key?

We could go pretty with this if it works.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 24, 2005, 04:05 PM
The Custom PHP.ini File:(Adjust it to fit your needs)
memory_limit = 400M;
upload_max_filesize = 20M;
max_execution_time = 0;
max_execution_time = 0;
register_globals = on;
error_reporting  =  E_ALL & ~E_NOTICE & ~E_WARNING


In Install.php:
<?phpsystem("php -c /kunden/homepages/17/d105382477/htdocs/BotTest/php.ini File -f Bot.php", $retval);echo("The Execution Returned: $retval");?>


PLEASE NOTE..THIS CODE WILL ONLY WORK ON THE SERVER I HAVE IT ON. PLEASE REPLACE /kunden/homepages/17/d105382477/htdocs/BotTest/ WITH THE LOCATION OF THE CUSTOM PHP.INI FILE

Alrighty. i have the bot done, but MAN I LOVE DEBUGGING MY OWN CODE!, lemmie just work out all the bugs
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 24, 2005, 05:22 PM
Need some help:

Parse error: parse error, unexpected $ in /homepages/17/d105382477/htdocs/BotTest/bot.php on line 90


With this code:
<?php$config = Array();$config['server'] = "useast.bettle.net";$config['port'] = 6112;$config['username'] = "";$config['password'] = "";$config['home'] = "public Chat PHP";$config['idle'] = "/me ::..:: is a PHP Bot version 0.2 http://www.flawgaming.com for more Details ::..::";$config['timeout'] = 10;// =================================================================================// DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOUR DOING// =================================================================================$conn = Array();$conn['count'] = 0;$conn['info'] = "";$conn['discreason'] = "";$conn['terminate'] = FALSE;$conn['disconnect'] = FALSE;$conn['chat'] = chr(3).chr(4);$conn['enter'] = chr(10).chr(13);$conn['connection'] = fsockopen("tcp://".$config['server'], $config['port'], $Errno, $Errstr, $config['timeout']);if (!$conn['connection']) {	$conn['terminate'] = TRUE;	$conn['reason'] = "Unable to Connect to The server.";}if ($conn['terminate']) {	fputs($conn['connection'], $conn['chat']);	fputs($conn['connection'], $config['username']);	fputs($conn['connection'], $config['password']);	while ($conn['disconnect']) {		if (false === ($conn['info'] = fgets($conn['connection']))) {			$conn['terminate'] = TRUE;			$conn['disconnect'] = TRUE;			$conn['discreason'] = "Unable to Read incoming Data.";		}		$conn['refuse'] = strpos($info, "refused");		if ($conn['refuse']) {			$conn['terminate'] = TRUE;			$conn['disconnect'] = TRUE;			$conn['discreason'] = "The Connection to the server was refused.";		}		$conn['badlogin'] = strpos($info, "Login Incorrect");		if ($conn['refuse']) {			$conn['terminate'] = TRUE;			$conn['disconnect'] = TRUE;			$conn['discreason'] = "Invalid Username/Password.";		}		$conn['tmp'] = substr($conn['info'], 0 , 4);		$conn['tmp'] = "a".$conn['tmp'];		$conn['res'] = strpos($conn['info'], "2000");		if (!$conn['terminate']) {			fputs($conn['connection'], "/join ".$config['home'].$conn['enter']);			while (!$conn['abort']) {				$conn['info'] = fgets($conn['connection']);				$conn['tmp'] = substr($conn['info'], 0, 4);				$conn['tmp'] = "a".$conn['tmp'];				if (strpos($conn['tmp'], "2000")) {					$conn['count'] = $conn['count'] + 1;					if ($conn['count'] >= 20) {						$conn['terminate'] = TRUE;						$conn['disconnect'] = TRUE;						$conn['discreason'] = "Disconnect Count Reached.";					}					fputs($conn['connection'], $config['idle'].$conn['enter']);				}			}		}			if ($conn['connection']) {			fclose($conn['connection']);		}		if (!$conn['terminate']) {			echo "Terminated";		} else {			echo $conn['discreason'];		}	}?>
Title: Re: [PHP] Bringing Back the Bot
Post by: R.a.B.B.i.T on May 25, 2005, 06:21 PM
Writing your own code would probably help you fix errors.  People here don't much like helping people who come and say "fix this other person's broken code".  It just doesn't work out too well.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 25, 2005, 06:30 PM
Quote from: rabbit on May 25, 2005, 06:21 PM
Writing your own code would probably help you fix errors.  People here don't much like helping people who come and say "fix this other person's broken code".  It just doesn't work out too well.

I did write my own code and thats my code.
Title: Re: [PHP] Bringing Back the Bot
Post by: Banana fanna fo fanna on May 25, 2005, 07:41 PM
Quote from: rabbit on May 25, 2005, 06:21 PM
Writing your own code would probably help you fix errors.  People here don't much like helping people who come and say "fix this other person's broken code".  It just doesn't work out too well.

You're a douchebag.
Title: Re: [PHP] Bringing Back the Bot
Post by: MyndFyre on May 25, 2005, 09:13 PM
Quote from: AC_Drkan on May 24, 2005, 05:22 PM
Need some help:

Parse error: parse error, unexpected $ in /homepages/17/d105382477/htdocs/BotTest/bot.php on line 90


With this code:

Almost universally in scripting languages, errors like this indicate something along the lines of an unterminated string constant, an unclosed brace, or something similar.  What do I mean by "like this?"  Well, I pasted your code into notepad, and line 90 (where the interpreter reports the error) is the end of the file.

Having scanned through your code, I didn't see anything like that, but I'm pretty tired and haven't gotten much sleep the past couple days, so I might have missed something.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 25, 2005, 09:28 PM
Quote from: MyndFyre on May 25, 2005, 09:13 PM
Quote from: AC_Drkan on May 24, 2005, 05:22 PM
Need some help:

Parse error: parse error, unexpected $ in /homepages/17/d105382477/htdocs/BotTest/bot.php on line 90


With this code:

Almost universally in scripting languages, errors like this indicate something along the lines of an unterminated string constant, an unclosed brace, or something similar.  What do I mean by "like this?"  Well, I pasted your code into notepad, and line 90 (where the interpreter reports the error) is the end of the file.

Having scanned through your code, I didn't see anything like that, but I'm pretty tired and haven't gotten much sleep the past couple days, so I might have missed something.

Yeah. I plugged it into a few debuggers cause i got tired of the error and found nothing.

I decided to rewrite it from scratch. will post code later on, im tired right now.. Good Night all.
Title: Re: [PHP] Bringing Back the Bot
Post by: R.a.B.B.i.T on May 26, 2005, 05:47 PM
Quote$config['idle'] = "/me ::..:: is a PHP Bot version 0.2 http://www.flawgaming.com for more Details ::..::";
Didn't look like it to me, sorry.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 27, 2005, 03:20 PM
Quote from: rabbit on May 26, 2005, 05:47 PM
Quote$config['idle'] = "/me ::..:: is a PHP Bot version 0.2 http://www.flawgaming.com for more Details ::..::";
Didn't look like it to me, sorry.

Actually, thats my domain. registered to me. Want me to change it to something?

well when i get more than 5 minutes where i can actually do something then i will change it.
See i have a life. A job. A gf.

AND BY THE WAY. i left you a little not at the bottom of the page. view it to find the note.
Title: Re: [PHP] Bringing Back the Bot
Post by: Banana fanna fo fanna on May 28, 2005, 08:46 PM
Quote from: AC_Drkan on May 27, 2005, 03:20 PM
Quote from: rabbit on May 26, 2005, 05:47 PM
Quote$config['idle'] = "/me ::..:: is a PHP Bot version 0.2 http://www.flawgaming.com for more Details ::..::";
Didn't look like it to me, sorry.

Actually, thats my domain. registered to me. Want me to change it to something?

well when i get more than 5 minutes where i can actually do something then i will change it.
See i have a life. A job. A gf.

AND BY THE WAY. i left you a little not at the bottom of the page. view it to find the note.

wahhhhh
Title: Re: [PHP] Bringing Back the Bot
Post by: Warrior on May 28, 2005, 09:30 PM
Good Job, AC_Drkan.

Title: Re: [PHP] Bringing Back the Bot
Post by: R.a.B.B.i.T on May 29, 2005, 09:36 AM
The first thing I thought was "flawed".

Also, if you have enough time to change the source to your page, you should have enough time to order a different domain, which takes all of TWO MINUTES.

Finally, like I care what someone thinks if they can't even spell "newb".  You're a dumbass.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 29, 2005, 09:48 PM
Quote from: rabbit on May 29, 2005, 09:36 AM
The first thing I thought was "flawed".

Also, if you have enough time to change the source to your page, you should have enough time to order a different domain, which takes all of TWO MINUTES.

Finally, like I care what someone thinks if they can't even spell "newb".  You're a dumbass.
Please uninstall CS and any other game your have.

Thats called l337 speak. or LEET, just for you.

|24|3|317
Is your username rabbit spelled in l337 speak

Me a dumbass.......look whos being an ass. U R (oops sorry) YOUR ARE.

Don't deny it, i could own you so bad in CS My score on average is about(out of 100 rounds) is 97(kills) to 14(deaths).

And let me guess, youll post a message saying oh yeah....well my score is 5 million - 1, but lemmie guess your score...

-10(kills) to 90(deaths)
Title: Re: [PHP] Bringing Back the Bot
Post by: UserLoser. on May 29, 2005, 10:22 PM
Quote from: AC_Drkan on May 29, 2005, 09:48 PM
Quote from: rabbit on May 29, 2005, 09:36 AM
The first thing I thought was "flawed".

Also, if you have enough time to change the source to your page, you should have enough time to order a different domain, which takes all of TWO MINUTES.

Finally, like I care what someone thinks if they can't even spell "newb".  You're a dumbass.
Please uninstall CS and any other game your have.

Thats called l337 speak. or LEET, just for you.

|24|3|317
Is your username rabbit spelled in l337 speak

Me a dumbass.......look whos being an ass. U R (oops sorry) YOUR ARE.

Don't deny it, i could own you so bad in CS My score on average is about(out of 100 rounds) is 97(kills) to 14(deaths).

And let me guess, youll post a message saying oh yeah....well my score is 5 million - 1, but lemmie guess your score...

-10(kills) to 90(deaths)

userloser.net:27016
Title: Re: [PHP] Bringing Back the Bot
Post by: Blaze on May 29, 2005, 11:12 PM
Actually, rabbit was quite good last time I played him.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on May 30, 2005, 11:25 AM
Quote from: UserLoser on May 29, 2005, 10:22 PM
userloser.net:27016

If i ever have time to go play on it ill join it.

Your server is down at 12:30 EST time.

My server, whenever i get the chance to run it, is

68.50.77.212:27020
Title: Re: [PHP] Bringing Back the Bot
Post by: NicoQwertyu on May 30, 2005, 11:06 PM
64.154.38.23:27015 is where the party's at.

Edit: Either Warrior or Banana, please turn off your email notification.
Title: Re: [PHP] Bringing Back the Bot
Post by: Warrior on May 31, 2005, 06:18 PM
Not i
Title: Re: [PHP] Bringing Back the Bot
Post by: R.a.B.B.i.T on June 01, 2005, 10:00 PM
Quote from: AC_Drkan on May 29, 2005, 09:48 PM
Quote from: rabbit on May 29, 2005, 09:36 AM
The first thing I thought was "flawed".

Also, if you have enough time to change the source to your page, you should have enough time to order a different domain, which takes all of TWO MINUTES.

Finally, like I care what someone thinks if they can't even spell "newb".  You're a dumbass.
Please uninstall CS and any other game your have.

Thats called l337 speak. or LEET, just for you.

|24|3|317
Is your username rabbit spelled in l337 speak

Me a dumbass.......look whos being an ass. U R (oops sorry) YOUR ARE.

Don't deny it, i could own you so bad in CS My score on average is about(out of 100 rounds) is 97(kills) to 14(deaths).

And let me guess, youll post a message saying oh yeah....well my score is 5 million - 1, but lemmie guess your score...

-10(kills) to 90(deaths)
I know what l33tspeak is, but it's still evidence of whoever "speaks" with it is a complete moron.  If you want to insult me, try not to make yourself look retarded in the process.
Title: Re: [PHP] Bringing Back the Bot
Post by: AC_Drkan on June 02, 2005, 05:39 AM
Quote from: rabbit on June 01, 2005, 10:00 PM
Quote from: AC_Drkan on May 29, 2005, 09:48 PM
Quote from: rabbit on May 29, 2005, 09:36 AM
The first thing I thought was "flawed".

Also, if you have enough time to change the source to your page, you should have enough time to order a different domain, which takes all of TWO MINUTES.

Finally, like I care what someone thinks if they can't even spell "newb".  You're a dumbass.
Please uninstall CS and any other game your have.

Thats called l337 speak. or LEET, just for you.

|24|3|317
Is your username rabbit spelled in l337 speak

Me a dumbass.......look whos being an ass. U R (oops sorry) YOUR ARE.

Don't deny it, i could own you so bad in CS My score on average is about(out of 100 rounds) is 97(kills) to 14(deaths).

And let me guess, youll post a message saying oh yeah....well my score is 5 million - 1, but lemmie guess your score...

-10(kills) to 90(deaths)
I know what l33tspeak is, but it's still evidence of whoever "speaks" with it is a complete moron.  If you want to insult me, try not to make yourself look retarded in the process.

my server today. 5:00. Be there. Ill even take little demos for all to download.