(This post was last modified: 10.05.2013, 12:41 by SlimShady95.)
10.05.2013, 12:31
(10.05.2013, 09:58)parat26 Wrote: All right Manuel, I renamed include.inc.php to include2.inc.php (and put the code in the file) and changed the bot code. No hope yet to get it working, as the same error occurs when I go to localhost/barbar.php (just to check for errors).
Fatal error: Call to a member function on a non-object in C:\Users\thanos\My Docs\Tribal Wars\TWLan 1.4\htdocs\barbar.php on line 40
Also, do I have to include it to game.php still?
Any ideas?
*EDIT: I've also noticed that changing the include.inc.php corrupts superbot for some reason (white screen?).
Thanos.
Well, if you want I can came to you via teamviewer, that would make the whole thing more easy. ^^
(09.05.2013, 20:34)Molt Wrote: Fragwürdig ist da noch milde formuliert.
lib/functions.php, Zeilen 1066 und 1067 (simulate()):
PHP Code:// Verteidiger immer zusützlich etwas abziehen, weil sie zu deff zu kämpfen sind ;D
$defPoints = $defPoints / 1.03;
Hier noch was schönes aus der functions.php:
PHP Code:
function unit_running($x,$y,$cordx,$cordy,$pro_feld)
{
global $config;
if ($x > $cordx) { $xfelder = $x - $cordx; } else { $xfelder = $cordx - $x; }
if ($y > $cordy) { $yfelder = $y - $cordy; } else { $yfelder = $cordy - $y; }
if ($xfelder > $yfelder) { $schief = $yfelder; } else { $schief = $xfelder; }
if ($xfelder > $yfelder) { $gerade = $xfelder - $yfelder; } else { $gerade = $yfelder - $xfelder; }
$time1 = $gerade * $pro_feld;
$time2 = $schief * (1.4142 * $pro_feld);
$komplett = $time1 + $time2;
$komplett = ($komplett / $config->get('speed')) / $config->get('movement_speed');
RETURN round($komplett);
}
PHP Code:
function unit_running($x1, $y1, $x2, $y2)
{
return ceil(sqrt(pow($x1 - $x2, 2) + pow($y1 - $y2, 2)));
}
MfG Manuel