Ejemplo n.º 1
0
    $seed1 = -1;
}
if (rand(1, 999) % 2 == 0) {
    $seed2 = -1;
}
if ($_GET['hood'] < 1) {
    die("Wrong hood number");
}
$coord = $gangsta->get_coord($_GET['hood']);
$x = $coord[0] + rand(1, 99) * $seed1;
$y = $coord[1] + rand(1, 99) * $seed2;
$gangs = $gangsta->get_map(array('x' => $x, 'y' => $y));
$gang_hit = $wave = 0;
$max_waves = 4;
$sleep_time = 90;
$total_gangs = count($gangs);
//$total_gangs = 30;
$gangs = array_reverse($gangs);
credits();
$start_time = time_start();
foreach ($gangs as $g) {
    $gangsta->attack($g['x'], $g['y']);
    // Check match waves and sleep
    ++$wave;
    ++$gang_hit;
    die;
}
time_end();
echo cli_message("Total gangs in array = {$total_gangs}\nTotal gangs hit = {$gang_hit}");
// display result
print json_decode($result);
Ejemplo n.º 2
0
        return $this;
        echo cli_message("\n            DEBUG DUMP\n\n            \t\t----------------------\n            \t\t\t Result = {$this->_result} \n\n            \t\t\t Result Info = {$this->_info} \n\n            \t\t\t Error Code = {$this->_error_code} \n\n            \t\t\t Error Message = {$this->_error_msg} \n\n\n            ");
        return $this;
    }
}
$gangsta = new Wangsta($realm_id, $realm, $MI2Coords, $uid, $wgangsta, $hoods);
// i use default but you can configure troops here
/*
	$units = array(
		"Romeo" => 5000
	);
*/
$units = false;
$gangsta->set_troops($units);
$seed1 = $seed2 = 1;
if (rand(1, 999) % 2 == 0) {
    $seed1 = -1;
}
if (rand(1, 999) % 2 == 0) {
    $seed2 = -1;
}
if ($_GET['hood'] < 1) {
    die("Wrong hood number");
}
$max_waves = 4;
$sleep_time = 90;
$gangsta->attack();
time_end();
echo cli_message("Done");
// display result
print json_decode($result);