Ejemplo n.º 1
0
function BotBuild($obj_id)
{
    global $BotID, $BotNow, $GlobalUni;
    $user = LoadUser($BotID);
    $aktplanet = GetPlanet($user['aktplanet']);
    $level = $aktplanet['b' . $obj_id] + 1;
    $text = CanBuild($user, $aktplanet, $obj_id, $level, 0);
    if ($text === '') {
        $speed = $GlobalUni['speed'];
        $duration = floor(BuildDuration($obj_id, $level, $aktplanet['b14'], $aktplanet['b15'], $speed));
        BuildEnque($user['aktplanet'], $obj_id, 0, $BotNow);
        UpdatePlanetActivity($user['aktplanet'], $BotNow);
        return $duration;
    } else {
        return 0;
    }
}
Ejemplo n.º 2
0
<?php

// Империя.
loca_add("menu", $GlobalUni['lang']);
loca_add("empire", $GlobalUni['lang']);
if (key_exists('cp', $_GET)) {
    SelectPlanet($GlobalUser['player_id'], intval($_GET['cp']));
}
$GlobalUser['aktplanet'] = GetSelectedPlanet($GlobalUser['player_id']);
// Обработка параметров.
if (key_exists('modus', $_GET) && !$GlobalUser['vacation']) {
    if ($_GET['modus'] === 'add') {
        BuildEnque(intval($_GET['planet']), intval($_GET['techid']), 0);
    } else {
        if ($_GET['modus'] === 'destroy') {
            BuildEnque(intval($_GET['planet']), intval($_GET['techid']), 1);
        } else {
            if ($_GET['modus'] === 'remove') {
                BuildDeque(intval($_GET['planet']), intval($_GET['listid']));
            }
        }
    }
}
$now = time();
UpdateQueue($now);
$aktplanet = GetPlanet($GlobalUser['aktplanet']);
$aktplanet = ProdResources($aktplanet, $aktplanet['lastpeek'], $now);
UpdatePlanetActivity($aktplanet['planet_id']);
UpdateLastClick($GlobalUser['player_id']);
$session = $_GET['session'];
PageHeader("imperium", true);