Example #1
0
function being_attacked()
{
    global $server;
    // <td><b class="c5 f10" align="right">&raquo; 1</b></td>
    // <td><b class="c5 f10">攻&#25802;</b></td>
    // <td align="center" class="f10">在</td>
    // <td class="f10"><span id=timer2>0:27:23</span> 小時</td>
    $url = "http://{$server}/dorf1.php";
    $ch = my_curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    $result = curl_exec($ch);
    curl_close($ch);
    $ret = detect_attack($result);
    if ($ret == 0) {
        return true;
    }
    return false;
}
Example #2
0
             $cart_capacity = 500;
         }
     }
 }
 echo "\n +++++++ {$name} +++++++\n";
 if ($auto_transfer > 0) {
     if (build_task_exist($account, $village)) {
         $result = switch_village($village);
         build($village, $result, $newbie);
     }
     transfer_to_village($village, $auto_transfer);
 } else {
     if ($village > 0) {
         $result = switch_village($village);
     }
     $attack_time_left = detect_attack($result);
     if ($attack_time_left > 900) {
         $next_check_time = min($next_check_time, $attack_time_left - 900);
     }
     $oasis_attack_time_left = detect_oasis_attack($result);
     update_check_time($result);
     build($village, $result, $newbie);
     list($wood, $brick, $iron, $crop, $warehouse_capacity, , , $granary_capacity) = get_res_info($result);
     if ($village == $main_village) {
         detect_message($result, $account, $message, $user, $server);
         if ($attack_time_left >= 0 && $beacon == 0) {
             $sql = "update accounts set beacon = 1 where id = {$account}";
             if (!mysql_query($sql)) {
                 die(mysql_error());
             }
             $title = "{$server},{$user},{$attack_time_left}";