New Content - Implemented Folder Holder: August's back to school IotM!

Bale

Minion
There are gonna be a lot more items listed in this thread since there are 23 folders. Many of them can be purchased in stores, so it will go into a lot of places in the code, including coinmasters.

The over-the-shoulder Folder Holder can hold up to 3 folders at a time. They do not reset on ascension, so mafia needs a permanent preference to keep track of them.

Now to start it off, here are the basic items.


Unknown item found: Folder Holder (4930, 281209058)
--------------------
4930 Folder Holder 281209058 folderholder.gif usable t 0
# Folder Holder
--------------------
You acquire an item: Folder Holder
Unknown item found: over-the-shoulder Folder Holder (6617, 868830919)
--------------------
6617 over-the-shoulder Folder Holder 868830919 folderholder2.gif accessory 0
over-the-shoulder Folder Holder 0 none
over-the-shoulder Folder Holder Single Equip, Softcore Only
--------------------
You acquire an item: over-the-shoulder Folder Holder
 

Bale

Minion
General store has a back to school special on three folders:

HTML:
<td colspan=4 align=center>— <b>Back to School!</b> —</td></tr><tr><td colspan=4 height=1 bgcolor=black> </td></tr><tr><td valign=center><input type=radio name=whichitem value=6619></td><td><img src="http://images.kingdomofloathing.com/itemimages/folder2.gif" class=hand onClick='javascript:descitem(968651348)'></td><td valign=center><a onClick='javascript:descitem(968651348)'><b>folder (blue)</b></a></td><td>10 Meat</td></tr><tr><td valign=center><input type=radio name=whichitem value=6620></td><td><img src="http://images.kingdomofloathing.com/itemimages/folder2.gif" class=hand onClick='javascript:descitem(984869155)'></td><td valign=center><a onClick='javascript:descitem(984869155)'><b>folder (green)</b></a></td><td>10 Meat</td></tr><tr><td valign=center><input type=radio name=whichitem value=6618></td><td><img src="http://images.kingdomofloathing.com/itemimages/folder2.gif" class=hand onClick='javascript:descitem(803733525)'></td><td valign=center><a onClick='javascript:descitem(803733525)'><b>folder (red)</b></a></td><td>10 Meat</td></tr><tr><td colspan=4 height=1 bgcolor=black> </td></tr><tr><td colspan=4 align=center>— <b>For The Kitchen</b>

Thre's one at the Arcade for 50 tokens:
HTML:
<tr><td><input type=radio name=whichitem value=6631></td><td><img style='vertical-align: middle' class=hand src='http://images.kingdomofloathing.com/itemimages/folder1.gif' onclick='descitem(155094068)' alt="folder (Jackass Plumber)" title="folder (Jackass Plumber)"></td><td><b>folder (Jackass Plumber)   </td><td><img style='vertical-align: middle' class=hand src='http://images.kingdomofloathing.com/itemimages/ggticket.gif' onclick='descitem(798956435)' alt="Game Grid ticket" title="Game Grid ticket"></td><td><b>50</b></td></tr>

Even at the Terrified Eagle Inn @ Dreadsylvania

The Terrified Eagle Inn buy 25 folder (tranquil landscape) ROW157
HTML:
<tr><td valign=center><input type=radio name=whichrow value=157></td><td><img src="http://images.kingdomofloathing.com/itemimages/folder1.gif" class=hand onClick='javascript:descitem(595837547)'></td><td valign=center><a onClick='javascript:descitem(595837547)'><b>folder (tranquil landscape)</b>    </a></td><td><img src=http://images.kingdomofloathing.com/itemimages/dv_krueggerand.gif width=30 height=30 onClick='javascript:descitem(901547610)' alt="Freddy Krueggerand" title="Freddy Krueggerand"></td><td><b>25</b> &nbsp</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td valign=center><input class=button type=button onClick='javascript:parent.mainpane.location="shop.php?whichshop=dv&action=buyitem&quantity=1&whichrow=157";' value='Buy'></td></tr>

In the Sea Monkey's Castle, Big Brother will sell me one for 25 sand dollars:
HTML:
<tr><td valign=center><input type=radio name=whichitem value=6636></td><td><img style='vertical-align: middle' class=hand src='http://images.kingdomofloathing.com/itemimages/folder1.gif' onclick='descitem(189052288)' alt="folder (dancing dolphins)" title="folder (dancing dolphins)"></td><td><b>folder (dancing dolphins)</b>    </td><td><img style='vertical-align: middle' class=hand src='http://images.kingdomofloathing.com/itemimages/sanddollar.gif' onclick='descitem(613536361)' alt="sand dollar" title="sand dollar"><td><b>25</b></td><tr>

Unknown item found: folder (blue) (6619, 968651348)
--------------------
6619 folder (blue) 968651348 usable t,d 5
folder (blue) Mysticality: +20
--------------------
Unknown item found: folder (green) (6620, 984869155)
--------------------
6620 folder (green) 984869155 usable t,d 5
folder (green) Moxie: +20
--------------------
Unknown item found: folder (red) (6618, 803733525)
--------------------
6618 folder (red) 803733525 usable t,d 5
folder (red) Muscle: +20
--------------------
Unknown item found: folder (Jackass Plumber) (6631, 155094068)
--------------------
6631 folder (Jackass Plumber) 155094068 usable t,d 5
folder (Jackass Plumber) Monster Level: +25
--------------------
Unknown item found: folder (tranquil landscape) (6638, 595837547)
--------------------
6638 folder (tranquil landscape) 595837547 usable t,d 5
folder (tranquil landscape) Damage Reduction: 15, HP Regen Min: 10, HP Regen Max: 20, MP Regen Min: 10, MP Regen Max: 20
--------------------
You acquire an item: folder (tranquil landscape)
Unknown item found: folder (dancing dolphins) (6636, 189052288)
--------------------
6636 folder (dancing dolphins) 189052288 usable t,d 5
# folder (dancing dolphins): +50% Item Drops (Underwater only)
--------------------
Unknown item found: folder (owl) (6639, 898277246)
--------------------
6639 folder (owl) 898277246 usable t,d 5
# folder (owl): +250% Item Drops from Monsters (Dreadsylvania only)
--------------------
 
Last edited:

Bale

Minion
The over-the-shoulder Folder Holder has a link to [manage]
HTML:
<a href=inventory.php?action=useholder><font size=1>[manage]</font></a>

That produces a page where folders can be added and removed. Unfortunately removing a folder DESTROYS it, so be sure to remove it from kolmafia's inventory.

HTML:
<html><head>
<script language=Javascript>
<!--
if (parent.frames.length == -1) location.href="game.php";
top.charpane.location.href="charpane.php";
//-->
</script>
<script language=Javascript src="/images/scripts/jquery-1.5.1.js"></script>
<script language=Javascript src="/images/scripts/keybinds.min.2.js"></script>
<script language=Javascript src="/images/scripts/window.20111231.js"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script>
function switchFocus()
{
	if (top.chatpane.document.chatform.graf.focus) 
		top.chatpane.document.chatform.graf.focus(); 
	return false;
}
function repeat()
{
	var linx = document.getElementsByTagName("A");
	for (var i = 0; i < linx.length; i++)
	{
		if (typeof timersfunc != 'undefined') {
			if (!timersfunc()) { 
				return; 
			}
			timersfunc = null;
		}
		var link = linx[i];
		if (link.innerHTML.match(/Adventure Again/) || link.innerHTML.match(/Do it again/))
			location.href = link.href;
	}
}

defaultBind(47, CTRL, switchFocus);
defaultBind(191, CTRL, switchFocus);
defaultBind(47, META, switchFocus);
defaultBind(191, META, switchFocus);
defaultBind(192, NONE, repeat);
defaultBind(220, NONE, repeat);
</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script type="text/javascript" src="/images/scripts/pop_query.20130705.js"></script>
<script type="text/javascript" src="/images/scripts/ircm.20120523.js"></script>
<script type="text/javascript">
function pop_ircm_contents(i, some) {
	var contents = '',
		shown = 0,
		da = ' <a href="#" rel="?" class="small dojaxy">[some]</a> <a href="#" rel="',
		db = '" class="small dojaxy">[all]</a>',
		dc = '<div style="width:100%; padding-bottom: 3px;" rel="',
		dd = '<a href="#" rel="1" class="small dojaxy">[';
	one = 'one'; ss=some;
if (i.d==1 && i.s>0) { shown++; 
contents += dc + 'sellstuff.php?action=sell&ajax=1&type=quant&whichitem%5B%5D=IID&howmany=NUM&pwd=5bef1e888144f86413da2705b070415d" id="pircm_'+i.id+'"><b>Auto-Sell ('+i.s+' meat):</b> '+dd+one+']</a>';
if (ss) { contents += da + i.n + db;}
contents += '</div>';
}
one = 'one'; ss=some;
if (i.q==0) { shown++; 
contents += dc + 'inventory.php?action=closetpush&ajax=1&whichitem=IID&qty=NUM&pwd=5bef1e888144f86413da2705b070415d" id="pircm_'+i.id+'"><b>Closet:</b> '+dd+one+']</a>';
if (ss) { contents += da + i.n + db;}
contents += '</div>';
}
one = 'one'; ss=some;
if (i.q==0 && i.g==0 && i.t==1) { shown++; 
contents += dc + 'managestore.php?action=additem&qty1=NUM&item1=IID&price1=&limit1=&ajax=1&pwd=5bef1e888144f86413da2705b070415d" id="pircm_'+i.id+'"><b>Stock in Mall:</b> '+dd+one+']</a>';
if (ss) { contents += da + i.n + db;}
contents += '</div>';
}
one = 'one'; ss=some;
if (i.q==0) { shown++; 
contents += dc + 'managecollection.php?action=put&ajax=1&whichitem1=IID&howmany1=NUM&pwd=5bef1e888144f86413da2705b070415d" id="pircm_'+i.id+'"><b>Add to Display Case:</b> '+dd+one+']</a>';
if (ss) { contents += da + i.n + db;}
contents += '</div>';
}

	return [contents, shown];
}
var todo = [];
function nextAction() {
	var next_todo = todo.shift();
	if (next_todo) {
		eval(next_todo);
	}
}
function dojax(dourl, afterFunc, hoverCaller, failureFunc) {
	$.ajax({
		type: 'GET', url: dourl, cache: false,
		global: false,
		success: function (out) {
			nextAction();
			if (out.match(/no\|/)) {
				var parts = out.split(/\|/);
				if (failureFunc) failureFunc(parts[1]);
				else $('#ChatWindow').append('<font color="green">Oops!  Sorry, Dave, you appear to be ' + parts[1] + '.</font><br />' + "\n");
				return;
			}

			if (hoverCaller)  {
				float_results(hoverCaller, out);
				if (afterFunc) { afterFunc(); }
				return;
			}
$(top.mainpane.document).find("#effdiv").remove(); if(!window.dontscroll || (window.dontscroll && dontscroll==0)) { window.scroll(0,0);}
			var $eff = $(top.mainpane.document).find('#effdiv');
			if ($eff.length == 0) {
				var d = top.mainpane.document.createElement('DIV');
				d.id = 'effdiv';
				var b = top.mainpane.document.body;
				if ($('#content_').length > 0) {
					b = $('#content_ div:first')[0];
				}
				b.insertBefore(d, b.firstChild);
				$eff = $(d);
			}
			$eff.find('a[name="effdivtop"]').remove().end()
				.prepend('<a name="effdivtop"></a><center>' + out + '</center>').css('display','block');
			if (!window.dontscroll || (window.dontscroll && dontscroll==0)) {
				top.mainpane.document.location = top.mainpane.document.location + "#effdivtop";
			}
			if (afterFunc) { afterFunc(); }
		}
	});
}
</script><script>

var currentkey = 49;
$(document).ready(function () {
	$('form').each(function () {
		var form = this;
		defaultBind(currentkey++, NONE, function () { form.submit(); });
		return currentkey < 58;
	});
});

</script><link rel="stylesheet" type="text/css" href="http://images.kingdomofloathing.com/styles.20120512.css">

<link rel='stylesheet' type='text/css' href='http://images.kingdomofloathing.com/actionbar.6.css'><!--[if IE]><link rel='stylesheet' type='text/css' href='http://images.kingdomofloathing.com/actionbar.ie.4.css'><![endif]--><script language="Javascript" src="/basics.js"></script><link rel="stylesheet" href="/basics.css" /></head>

<body><img src='http://images.kingdomofloathing.com/itemimages/blank.gif' id='dragged'><div id='debug'></div><div class=contextmenu id='skillmenu'></div><div class=contextmenu id='itemsmenu'></div><div id=topbar><center><table class=actionbar cellpadding=0 cellspacing=1><tbody><tr class=label><td> </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr class=blueback><td><a href='choice.php?action=auto'><img src='http://images.kingdomofloathing.com/itemimages/plexpock.gif'></td><td class=spacer></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif' id='skills'></td><td class=spacer></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td><td class=spacer></td><td class=spacer></td><td><img src='http://images.kingdomofloathing.com/itemimages/blank.gif'></td></tr><tr class=label><td>auto</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table></center></div><div class='content' id='content_'><div id='effdiv' style='display: none;'></div><div style='overflow: auto;'>
<Center><div id="results"><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Results:</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><span class='guts'>You carefully place your new folder in the holder</span></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></div><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Opening up the Folder Holder</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center>
<b>Contents of your Folder Holder</b>
<table>
  <tr>
        <td align="center" valign="top">       
       <img onclick="descitem(803733525)" alt="red" title="red" src="http://images.kingdomofloathing.com/otherimages/folders/folder01.gif" height="100" width="100" />
    </td><td width="10"><div style="width:10px"></td></td>
       <td align="center" valign="top">       
       <img onclick="descitem(803733525)" alt="An empty folder slot" title="An empty folder slot" src="http://images.kingdomofloathing.com/otherimages/folders/folder00.gif" height="100" width="100" />
    </td><td width="10"><div style="width:10px"></td></td>
       <td align="center" valign="top">       
       <img onclick="descitem(803733525)" alt="An empty folder slot" title="An empty folder slot" src="http://images.kingdomofloathing.com/otherimages/folders/folder00.gif" height="100" width="100" />
    </td><td width="10"><div style="width:10px"></td></td>
    
 </tr>
  <tr>
    <td valign='top' align='center'><b>red</b></td><td></td><td valign='top' align='center'><b>An empty folder slot</b></td><td></td><td valign='top' align='center'><b>An empty folder slot</b></td><td></td>  </tr>
  <tr> 
     
       <td align="center" valign="top">       
              <form method="post" action="choice.php" onsubmit="return confirm('Are you sure you want to destroy this folder by removing it?');">
          <input type="hidden" name="pwd" value="5bef1e888144f86413da2705b070415d" />
          <input type="hidden" name="whichchoice" value="774" />
          <input type="hidden" name="option" value="2" />
          <input type="hidden" name="slot" value="0" />
          <input type="submit" value="Remove" class="button" />
       </form>
              </td><td></td>
     
       <td align="center" valign="top">       
              </td><td></td>
     
       <td align="center" valign="top">       
              </td><td></td>
      </tr>
</table>
<p>
<center><b>Folders in your Inventory</b></center>
<table>
 <tr>
   <td valign="top">
      <table>
               <tr>
            <td valign="middle"><img src="http://images.kingdomofloathing.com/itemimages/folder2.gif" class="hand" onclick="descitem(968651348)" alt="blue" title="blue" /></td>
            <td valign="middle"><b>blue</b></td>
            <td valign="middle"> 
              <form method="post" action="choice.php" style="padding: 0; margin: 0">
               <input type="hidden" name="pwd" value="5bef1e888144f86413da2705b070415d" />
               <input type="hidden" name="whichchoice" value="774" />
               <input type="hidden" name="option" value="1" />
               <input type="hidden" name="folder" value="2" />
               <input type="submit" value="Insert" class="button"  />
              </form>
            </td>
         </tr>
               <tr>
            <td valign="middle"><img src="http://images.kingdomofloathing.com/itemimages/folder2.gif" class="hand" onclick="descitem(984869155)" alt="green" title="green" /></td>
            <td valign="middle"><b>green</b></td>
            <td valign="middle"> 
              <form method="post" action="choice.php" style="padding: 0; margin: 0">
               <input type="hidden" name="pwd" value="5bef1e888144f86413da2705b070415d" />
               <input type="hidden" name="whichchoice" value="774" />
               <input type="hidden" name="option" value="1" />
               <input type="hidden" name="folder" value="3" />
               <input type="submit" value="Insert" class="button"  />
              </form>
            </td>
         </tr>
            </table>
   </td>
   <td width="30"> </td>
   <td valign="top">
      <table>
               <tr>
            <td valign="middle"><img src="http://images.kingdomofloathing.com/itemimages/folder1.gif" class="hand" onclick="descitem(595837547)" alt="tranquil landscape" title="tranquil landscape" /></td>
            <td valign="middle"><b>tranquil landscape</b></td>
            <td valign="middle">
              <form method="post" action="choice.php" style="padding: 0; margin: 0">
               <input type="hidden" name="pwd" value="5bef1e888144f86413da2705b070415d" />
               <input type="hidden" name="whichchoice" value="774" />
               <input type="hidden" name="option" value="1" />
               <input type="hidden" name="folder" value="21" />
               <input type="submit" value="Insert"  class="button"   />
              </form>
            </td>
         </tr>
            </table>
   </td>
 </tr>
</table> 


<p><a href=inventory.php>Back to your Inventory</a>
</center>
</td></tr></table></center></td></tr><tr><td height=4></td></tr></table></div></div></body><script src="/onfocus.js"></script></html>
 

Bale

Minion
And this is the reason that I got the item: +250% item drop bonus in Dreadsylvania!

[3752] Dreadsylvanian Woods
Encounter: The Tallest Tree in the Forest
Encounter: Treebasing
Unknown item found: folder (owl) (6639, 898277246)
--------------------
6639 folder (owl) 898277246 usable t,d 5
# folder (owl): +250% Item Drops from Monsters (Dreadsylvania only)
--------------------
You acquire an item: folder (owl)

EDIT: I put that info in the first post also.
 
Last edited:

Veracity

Developer
Staff member
Fascinating. When you find a folder, it gives you a little image, but when you look at the item description, you get a much different image in a new location: rather than in "itemimages", it is in "otherimages/folders".

When you "manage" a folder, you get a choice.php page.

Here is inserting a folder:

choice.php?pwd&whichchoice=774&option=1&folder=22

Like the florist, this is a choice.php page that you can walk away from.

This is like a sticker sword - except, I hope the folders don't wear out!

I do not see a "folders" section in api.php to correspond to the "stickers" section, so, I'm not sure how we are supposed to know what folders you have in your folder holder.

I assume this is like the card sleeve and the folders you put in it persist across ascension and such.

This will be a fair amount of work!
 

Bale

Minion
This is like a sticker sword - except, I hope the folders don't wear out!

I spent several hundred turns in Dreadsylvania with +250% item drops. My owl folder is still fine.


I assume this is like the card sleeve and the folders you put in it persist across ascension and such.

This has been verified. I also stated it in the initial post.


Also, r12378 is not setting the correct image for the folders... Each folder has two images. One is the 30x30 image that is displayed in inventory. Unfortunately folders ALSO have a 100x100 image that is displayed on their item description. KoLmafia should set the former for use in scripts. It's causing me some trouble having it show up correctly in my OCD dB script.
 

Veracity

Developer
Staff member
Huh. I went to extra work to get the image out of the item description. I'll have to think what to do about that.
 

Veracity

Developer
Staff member
This has been verified. I also stated it in the initial post.
They do not reset on ascension, so mafia needs a permanent preference to keep track of them.
Ah, yes - you did say that they do not reset. However, your conclusion is incorrect, if only because you can remove folders outside of KoLmafia.

KoL needs to put the folders into api.php. I submitted a bug report to KoL requesting this:

I just bought a folder holder (with real donation money :)

It looks like a sticker weapon in that it can hold three things and there is a special page - a choice.php choice, in this case - to manage them.

It also looks like a card sleeve, in that you can both insert and remove folders. By analogy, I'd guess the folders it contains persist across ascension. Or perhaps ascension empties them when it goes to storage. Whatever.

Looking at api.php, I don't see anything in the status to tell me what folders are currently loaded.

Can we get a "folders":[0,0,0] array, just like the "stickers":[0,0,0] array, please?

Thanks!
 

Darzil

Developer
7 item drops in 416 adventures with +789% items (500 of which came from the Owl folder), so many more than before I had it. Didn't look like rate was much different for Almanac pages (got 5) or Marks (got 1).
 

Veracity

Developer
Staff member
Also, r12378 is not setting the correct image for the folders... Each folder has two images. One is the 30x30 image that is displayed in inventory. Unfortunately folders ALSO have a 100x100 image that is displayed on their item description. KoLmafia should set the former for use in scripts. It's causing me some trouble having it show up correctly in my OCD dB script.
I've been pondering this and I have come to a few conclusions.

- I disagree that KoLmafia is not using the "correct" image, as you put it. It is using the ONLY image that it is able to discover automatically - that which appears in the item description.
- The image in inventory - or in the mall or what you see when it drops - is visible only in those pages; there is no way for KoLmafia to know what the image is unless we manually enter the image into the data file.
- I disagree that KoLmafia "should" throw away the information that it scraped from the item description and, instead, return a manually entered value.

Looking at the HTML you posted, I see "itemimages/folder1.gif" and "itemimages/folder2.gif". There seems to be no way to know, a priori, which image is used for which folder.

Now, you could do this:

Code:
string smallimage( item it )
{
    string image = it.image;
    return image.contains_text( "/folders/" ) ? "folder1.gif" : image;
}
Or, alternatively, I could add a "smallimage" proxy field to the item type which would do exactly that within KoLmafia; I am quite certain that I am not interested in figuring out which folders are "folder1" and which are "folder2".

In either case, I am not willing to throw away the information that KoLmafia scrapes from the item description, so one or the other of us will have to map the image name in the way I describe.

Considering that I went to some trouble to allow KoLmafia to successfully scrape the image name for folders from the item description - as opposed to not having any image at all - your characterizing the result as "wrong" annoys me - and I am therefore inclined to suggest that it is the job of the script to figure out a "small" image, if it is important to it, although I am open to hearing arguments to the contrary.
 

Bale

Minion
Thank you for the suggestion. I figured out which folders and folder1 and which are folder2. I'm now doing it like this:

PHP:
string icon(string img) {
	if(!contains_text(img, "/"))
		return "itemimages/"+ img;
	if(contains_text(img, "/folders/"))
		switch(substring(img, 26,28)) {
			case "01": case "02": case "03": case "04": case "05": case "07": case "09": case "10": case "12": case "13": case "15": 
				return "itemimages/folder1.gif";
			case "06": case "08": case "11": case "14": case "16": case "17": case "18": case "19": case "20": case "21": case "22": case "23": 
				return "itemimages/folder2.gif";
		}
	return img;
}
 

Veracity

Developer
Staff member
Since you went to the trouble of looking up all the folders, you have the option to use it.smallimage in revision 12408.
 

Bale

Minion
Bad news. I reversed folder1 and folder2 in my example above. Sorry. I just tested it and fixed my bug. :(

This is one time that you were too fast for me.
 
Top