Heyy, was like 2+ months since I've really worked with PHP, I've lost my PHP brain xD
But w/e, I made this 'lil script
Not so usefull, but it creates like a Lua table like:
[itemid] = "article"
Hope it'll be used by sum1 lol xD
But w/e, I made this 'lil script
PHP:
<font face="verdana" style="font-size: 11px;">Paste your items.xml here!</font><br />
<form action="" method="POST" style="display: inline;">
<textarea cols="120" rows="10" name="text" style="font: 10px verdana;"><?php /*<?php echo $_POST["text"]; ?>*/ ?></textarea><br />
<font face="verdana" style="font-size: 11px;">Exceptions:</font>
<input type="text" name="exceptions" value="a,an" style="font: 10px verdana;" /> <i>(separate with comma)</i><br />
<input type="submit" value="Convert to Lua!" />
</form><br /><br />
<?php
$items_xml = $_POST["text"];
if ($items_xml) {
preg_match_all("/\<item id=\"(\d+)\" article=\"(.*?)\" name=\".*\">/", $items_xml, $itemInfo);
$itemList = array_combine($itemInfo[1], $itemInfo[2]);
$exceptions = explode(",", $_POST["exceptions"]);
foreach ($exceptions as $key => $exception) {
$exceptions[$key] = trim($exception);
}
echo "<font face=\"verdana\" style=\"font-size: 11px;\">Copy your items.lua!</font><br />
<textarea cols=\"120\" rows=\"10\" style=\"font: 10px verdana;\">itemArticles = {\n";
foreach ($itemList as $itemID => $itemArticle) {
if (!in_array($itemArticle, $exceptions)) {
echo "\t[$itemID] = \"$itemArticle\",\n";
}
}
echo "}</textarea>";
}
Not so usefull, but it creates like a Lua table like:
[itemid] = "article"
Hope it'll be used by sum1 lol xD