Valhalla Legends Forums Archive | Web Development | [PHP] PHP Errors.

AuthorMessageTime
AC_Drkan
Geez i hate debugging,
[code]
Parse error: parse error, unexpected T_VARIABLE in /Spam-East.php on line 9
[/code]
with the following code:
[code]
<?php

Echo("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;
}
}
[/code]

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

November 3, 2004, 1:49 AM
Myndfyr
[quote author=AC_Drkan link=topic=9406.msg87186#msg87186 date=1099446572]
Geez i hate debugging,
[/quote]
Then don't try to program.
[quote author=AC_Drkan link=topic=9406.msg87186#msg87186 date=1099446572]
[code]
Parse error: parse error, unexpected T_VARIABLE in /Spam-East.php on line 9
[/code]
with the following code:
[code]
<?php

Echo("Starting Battle.net Bot.....");
SpamEast();

function SpamEast() {
$Server = "Useast.Battle.Net";
$Port = 6112
$username = "";
[/code]
[/quote]

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

[code]
function SpamEast() {
$Server = "Useast.Battle.Net";
$Port = 6112;
$username = "";
[/code]
November 3, 2004, 2:02 AM
CrAzY
Why spam Battle.net? People like you make the internet a very bad place.
November 8, 2004, 10:47 PM
j0k3r
[quote author=CrAzY link=topic=9406.msg87962#msg87962 date=1099954041]
Why spam Battle.net? People like you make the internet a very bad place.
[/quote]
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.
November 8, 2004, 11:27 PM
AC_Drkan
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.

:(
November 9, 2004, 9:44 PM
venox
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.
November 9, 2004, 10:20 PM
AC_Drkan
[quote author=venox link=topic=9406.msg88117#msg88117 date=1100038820]
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.
[/quote]

im on dial up, its pointless, im on like for 2 hours each day.
November 10, 2004, 11:00 AM
LivedKrad
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
November 20, 2004, 2:04 PM

Search