", $f, $c, $d);
}
if (!empty($_POST['pasteregion'])) {
$pasteregion = stripslashes($_POST['pasteregion']);
#preg_match("/Forkortelse:\t(.+)\ \t/", $_POST['pasteregion'], $tag);
#preg_match("/Navn:\t(.+)\n/", $_POST['pasteregion'], $alliance);
$len = strlen($pasteregion);
#$varray = explode("\n", $pasteregion);
/* Find action element */
//$pasteregion = "
";
if ($matches = preg_split("~<(/?)([^>]*)>~", $pasteregion,-1,PREG_SPLIT_DELIM_CAPTURE)) {
foreach ($matches as $i=>$value) {
if ($value == "table cellspacing=\"1\" cellpadding=\"2\" class=\"tbg\"") {
$mark = $i;
/* $townlink = $matches[$i+9];
$town = $matches[$i+13];
$ownlink = $matches[$i+27];
$description = $matches[$i+31];
$timer = $matches[$i+244];
$arrival = $matches[$i+253];
*/
list($d,$c) = extract_d($matches[$i+9]);
list($x,$y) = ztoxy($d);
if (!empty($matches[$i+244]) and !empty($matches[$i+253]) and !empty($d)) {
$Incoming[] = array(
'village' => $matches[$i+13],
'x' => $x,
'y' => $y,
'id' => $d,
'c' => $c,
// 'townlink' => $townlink,
'description' => $matches[$i+31],
'timer' => $matches[$i+244],
'arrival' => $matches[$i+253]
);
}
//printf("Incoming %d (%s) (%s)
\n", $i, $town, $townlink);
} elseif (!empty($value)) {
//printf("[%d] [%d] %s
", $i, $i-$mark, htmlspecialchars($value));
}
}
echo ""; print_r($Incoming); echo "
\n";
} else {
printf("No luck
\n");
}
//printf("String (%s)
\n", htmlspecialchars($pasteregion));
#$spos = strpos($pasteregion, "\tSpillere \t");
#$spos = $spos+36;
#$epos = strpos($pasteregion, "Landsbyer:");
#$epos = $epos-2;
#$plen = $epos-$spos;
#$players = substr($pasteregion, $spos, $plen);
#$parray = explode("\n", $players);
#echo "(".$spos.")"i;
#printf("(%d/%d/$d") (%s)", $spos, $epos, $plen, $players);
}
?>
Rally Point Parser
\n";
}
*/
?>