***DISCLAIMER***
If you don't know what PHP is, or a webserver, this tool is not for you.
**Edited 1/20/09**
Fixed an ordering issue on parsing so that equipment with the word "Gold" in it would not appear in the gold section.
Took "Elixirs" out of the items.txt file so they would no longer show up under equipment.
Links and source updated.
On to the meat:
The tool basically allows you to select your console logs from AGBot and view the parsed out files to show what and how many of each your bot has picked up during that bot session.
There is no javascript, there is no pretty. All it does is work.
The script will attempt to create 1 (one) file: "pickups.ini" in the same directory as itself to retain the path to the log files only.
Here's the link (which contains the script and an items.txt file:

Just in case you're bored or whatever and somehow think PHP is going to "ZOMG ITS A TROJANZ IT HAXx0R3D MY COMPUTARZz!!!1111ONE!!ELEVEN!!"
Here's the source for the script itself:
Code:
<title>Pickups</title>
<title>Pickups</title>
<?php
/*
Created By: IGotArrows
On: 1/19/08
Version: 1.0
Credits: The Rev6 AGBot Team for the original raw data file for the items list which the item names were parsed out of for the equipment portion of this script.
*/
if($_GET[submit] == 'Save' && $_GET[dir] <> ''){ #checking for valid form and non-empty
$fp = fopen('pickups.ini','w');
fwrite($fp,$_GET[dir]);
fclose($fp);
}
if(file_exists('pickups.ini') !== true){ # Checking for ini
echo '<form method=get action=pickups.php>';
echo '<b>Type in the complete path to the folder of your console logs.</b><p>';
echo '<input type=text name=dir><br>';
echo '<input type=submit name=submit value=Save>';
echo '</form>';
die;
}
$fini = file('pickups.ini'); # Read ini for location of logs.
$dir = $fini[0];
# $dir = 'c:\documents and settings\owner\desktop\silkroad\agbot';
$dirhandle = opendir($dir) or die('Unable to open directory.');
echo '<form method=get action=pickups.php>';
echo '<select name=log><option value="">Select File</a>';
while (false !== ($file = readdir($dirhandle))) { # Reading list of log files.
if (strpos($file, 'LogConsol') !== false){
# echo "<a href=\"chat.php?log=$dir\\$file\">" . $file . "</a><br>";
echo "<option value=\"$dir\\$file\">$file</option>";
}
}
echo '</select>';
echo '<input type=submit name=submit value="View Log">';
echo '</form>';
?>
<?php
# Generating item hash.
$file = $_GET[log];
$raw = file($file) or die('Unable to open file.');
$itemdata = file('items.txt');
foreach($itemdata as $val){
$items[trim($val)] = 1;
}
# Separate each "pickup" in to its own category.
foreach($raw as $val){
if(strpos($val,'Pick up Item :') !== false){
$temp = explode(': ',$val);
$val = trim($temp[2]);
if(array_key_exists(trim($val),$items)){
$myitems[] = $val;
}
elseif(preg_match("/Gold /",$val)){
$gold[] = $val;
}
elseif(preg_match("/HP Recovery /",$val)){
$pots[] = $val;
}
elseif(preg_match("/Intensifing Elixir/",$val)){
$elixers[] = $val;
}
elseif(preg_match("/Jade tablet of /",$val)){
$tabs[] = $val;
}
elseif(preg_match("/MP Recovery /",$val)){
$pots[] = $val;
}
elseif(preg_match("/Ruby tablet of /",$val)){
$tabs[] = $val;
}
elseif(preg_match("/Vigor Recovery /",$val)){
$pots[] = $val;
}
elseif(preg_match("/Universal Pill /",$val)){
$pots[] = $val;
}
else{
$misc[] = $val;
}
$full[] = $val;
}
}
# Sorting and creating hash tables for categories.
natcasesort($gold);
natcasesort($pots);
natcasesort($elixers);
natcasesort($tabs);
natcasesort($misc);
natcasesort($myitems);
$uniquegold = array_unique($gold);
$uniquepots = array_unique($pots);
$uniqueelixers = array_unique($elixers);
$uniquetabs = array_unique($tabs);
$uniquemyitems = array_unique($myitems);
$uniquemisc = array_unique($misc);
/* OUTPUT FUNCTIONS BELOW THIS */
# GOLD
$tdcount = 0;
foreach($gold as $val){
$uniquegold[$val] = ++$uniquegold[$val];
}
echo '<table width=100% border=1><tr><caption>Gold</caption></tr><tr>';
foreach($uniquegold as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
# EQUIPMENT
$tdcount = 0;
foreach($myitems as $val){
$uniquemyitems[$val] = ++$uniquemyitems[$val];
}
echo '<table width=100% border=1><tr><caption>Equipment</caption></tr><tr>';
foreach($uniquemyitems as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
# POTS
$tdcount = 0;
foreach($pots as $val){
$uniquepots[$val] = ++$uniquepots[$val];
}
echo '<table width=100% border=1><tr><caption>Pots</caption></tr><tr>';
foreach($uniquepots as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
# Elixers
$tdcount = 0;
foreach($elixers as $val){
$uniqueelixers[$val] = ++$uniqueelixers[$val];
}
echo '<table width=100% border=1><tr><caption>Elixers</caption></tr><tr>';
foreach($uniqueelixers as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
# TABS
$tdcount = 0;
foreach($tabs as $val){
$uniquetabs[$val] = ++$uniquetabs[$val];
}
echo '<table width=100% border=1><tr><caption>Tabs</caption></tr><tr>';
foreach($uniquetabs as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
# MISC
$tdcount = 0;
foreach($misc as $val){
$uniquemisc[$val] = ++$uniquemisc[$val];
}
echo '<table width=100% border=1><tr><caption>Ingredients/Items</caption></tr><tr>';
foreach($uniquemisc as $key => $val){
if (is_numeric($key) === false){
if($tdcount < 3){
echo "<td><b>$key: </b>$val</td>";
++$tdcount;
}
else{
echo "</tr><tr><td><b>$key: </b>$val</td>";
$tdcount = 1;
}
}
}
echo '</tr></table><p>';
?>






