GameItemTypeArtDef as $node=>$value) { $counter++; foreach($value->attributes() as $a => $b) { $internalname = $b->asXML(); } $internalname = substr ($internalname, 0, -1); $internalname = substr ($internalname, 15); foreach ($value->GameItemTypeModelPack as $storm => $thunder) { foreach ($thunder->SupportedUnitModelType as $key=>$key2){ if ($key2 == "KingdomMale") { foreach ($thunder->GameItemTypeModel as $night => $day) { $scroungemodelfile = substr((string) $day->ModelFile, strrpos((string) $day->ModelFile, "/")); $scroungemodelfile = substr($scroungemodelfile, strrpos($scroungemodelfile, "\\")+1); $scroungetexturefile = substr((string) $day->Texture_All, strrpos((string) $day->Texture_All, "/")); $scroungetexturefile = substr($scroungetexturefile, strrpos($scroungetexturefile, "\\")); //print (string) $day->ModelFile."
$scroungemodelfile

"; $array[$scroungemodelfile] = $scroungetexturefile; //$array[$internalname]['ModelFile'] = (string) $day->ModelFile; //$array[$internalname]['Texture'] = (string) $day->Texture_All; //print_r($day->ModelFile); } } } } } //$array = array_unique($array); ksort($array); //print_r($array); function find_all_files($dir) { $root = scandir($dir); foreach($root as $value) { if($value === '.' || $value === '..') {continue;} if(is_file("$dir/$value")) {$result[]="$dir/$value";continue;} foreach(find_all_files("$dir/$value") as $value) { $result[]=$value; } } return $result; } $dir2 = "C:\Program Files\Stardock Games\FallenEnchantress\Gfx"; $installdirfiles = find_all_files($dir2); foreach ($array as $key => $value) { foreach ($installdirfiles as $key2 => $value2) { if (strpos($value2, $key) != "0") { //print "$key = $value2\n"; exec("start C:\\Progra~2\\Havok\\HavokContentTools\\hctStandAloneFilterManager.exe -s \"C:\\Users\\Heavenfall\\Documents\\My Games\\FallenEnchantress\\Mods\\Gfx\\Stormworld\\ExpandedFactionsFE\\Shadows\\armor\\pre\\hko\\$key.hko\" \"C:\\Users\\Heavenfall\\Documents\\My Games\\FallenEnchantress\\Mods\\Gfx\\Stormworld\\ExpandedFactionsFE\\Shadows\\armor\\pre\\$key\""); print_r($out); print_r($out2); sleep("0.5"); } } }