Valhalla Legends Archive

Programming => Web Development => Topic started by: AC_Drkan on November 02, 2004, 07:49 PM

Title: [PHP] PHP Errors.
Post by: AC_Drkan on November 02, 2004, 07:49 PM
Geez i hate debugging,

Parse error: parse error, unexpected T_VARIABLE in /Spam-East.php on line 9

with the following code:

<?phpEcho("Starting Battle.net Bot.....");SpamEast();function SpamEast() {	$Server = "Useast.Battle.Net";	$Port = 6112	$username = "";	$password = "";	$terminate = false;	$abort = false;	$timeout = 10;	$skipa = 1;	$spammessage1 = "Hey Testing Testing Testing";		$Connection = fsockopen("tcp://".$Server, $Port, $Errno, $Errstr, $timeout);		if (!Connection) {		$terminate = true;		$reason = "Connection To Battle.net Failed";	}	if (!$terminate) {		$chat = chr(3).chr(4);		$enter = chr(10).chr(13);		fputs($connection, $constr);		fputs($connection, $username);		fputs($connection, $password);		while (!$abort && $skipa != 0) {			if (false === ($info = fgets($connection))) {				$abort = true;				$terminate = true;				$reason = "Socket Read Failed. Reason: ".socket_strerror($ret);			}			$refuse = strpos($info, "refused");			if ($refuse) {				$abort = true;				$terminate = true;				$reason = "Connection Was Refused.";			}			$badlogin = strpos($info, "Login Incorrect");			if ($badlogin) {				$abort = true;				$terminate = true;				$reason = "Login Incorrect";			}			$tmp = substr($info, 0 , 4);			$tmp = "a$tmp";			$res = strpos($info, "2000");						if (strpos($tmp, "2000")) {				$skipa ++;			}			$sd++;			if ($sd = 40) {				$abort = true;				$terminate = true;				$reason = "Server Timed Out";			}		}	}	if (!$terminate) {		fputs($connection, "/join Open Tech Support".$enter);		$skipa = 1;		$abort = false;		$sd = 0;				while ($skipa != 0 && !$abort) {			$info = fgets($connection);			$tmp = substr($info, 0, 4);			$tmp = "a$tmp";						if (strpos($tmp, "2000")) {				fputs($connection, $spammessage1.$enter);			}		}	}	if ($connection != "") {		fclose($connection);	}		if (!terminate) {		echo retu;	} else {		$error = "Abort ".$reason);		echo $error;	}}


Basically a modified version of the get stats function thats i tried to make it infinately loop.

Title: Re: [PHP] PHP Errors.
Post by: MyndFyre on November 02, 2004, 08:02 PM
Quote from: AC_Drkan on November 02, 2004, 07:49 PM
Geez i hate debugging,
Then don't try to program.
Quote from: AC_Drkan on November 02, 2004, 07:49 PM

Parse error: parse error, unexpected T_VARIABLE in /Spam-East.php on line 9

with the following code:

<?phpEcho("Starting Battle.net Bot.....");SpamEast();function SpamEast() {	$Server = "Useast.Battle.Net";	$Port = 6112	$username = "";


Line 8 does not terminate with a semicolon.  It should read:


function SpamEast() {
$Server = "Useast.Battle.Net";
$Port = 6112;
$username = "";
Title: Re: [PHP] PHP Errors.
Post by: CrAzY on November 08, 2004, 04:47 PM
Why spam Battle.net? People like you make the internet a very bad place.
Title: Re: [PHP] PHP Errors.
Post by: j0k3r on November 08, 2004, 05:27 PM
Quote from: CrAzY on November 08, 2004, 04:47 PM
Why spam Battle.net? People like you make the internet a very bad place.
Actually, people like him is what the internet is for. It's morons that use bots to spam crap that are the problem, not the ones making the programs.

Also, it's harmful to battle.net, not the internet.
Title: Re: [PHP] PHP Errors.
Post by: AC_Drkan on November 09, 2004, 03:44 PM
Ahh im starting a clan script hosting business and i want to get my website out on battle.net and since im on Dailup its kinda hard to do that.

:(
Title: Re: [PHP] PHP Errors.
Post by: venox on November 09, 2004, 04:20 PM
Are you planning to run this on a localhost?  I'm sure you are aware of the execution timeout setting... it's defaulted to 30 seconds.  If you plan to have this script connecting to bnet for longer than that.. you'll need to edit that setting.  If you are planning to run this from a server that you don't own/administrate then you will have little success getting this to work.  It'll connect for 30 seconds and then time out and disconnect....

And if you are running it from a localhost, that's pretty pointless; you can just use a bot instead of running a server and this script.
Title: Re: [PHP] PHP Errors.
Post by: AC_Drkan on November 10, 2004, 05:00 AM
Quote from: venox on November 09, 2004, 04:20 PM
Are you planning to run this on a localhost?  I'm sure you are aware of the execution timeout setting... it's defaulted to 30 seconds.  If you plan to have this script connecting to bnet for longer than that.. you'll need to edit that setting.  If you are planning to run this from a server that you don't own/administrate then you will have little success getting this to work.  It'll connect for 30 seconds and then time out and disconnect....

And if you are running it from a localhost, that's pretty pointless; you can just use a bot instead of running a server and this script.

im on dial up, its pointless, im on like for 2 hours each day.
Title: Re: [PHP] PHP Errors.
Post by: LivedKrad on November 20, 2004, 08:04 AM
I'd say it's a moderately good learning opportunity for people that would like to lightly see how sockets work, venox. Aside from that avenue of justification, it's a crap idea. :P