Kolmafia Item Lists: Singleton, Profitable, Mementos, and Junk - script use?

Stewbeef

New member
Is there any way for a script to access the item lists you can make via the GUI? (e.g. mementos, junk, singleton)

They aren't in an map format, so file_to_map won't work. There don't seem to be any properties that get associated with those items either.
 
Last edited:

lostcalpolydude

Developer
Staff member
You can iterate over all items, and use craft_type(), get_ingredients(), creatable_amount(), and maybe creatable_turns() to make some lists. Your question is vague enough that I don't actually know if this is responding to it.

Also, calling it annoying as part of your first post here is a good way to make people want to not help you.
 

fronobulax

Developer
Staff member
I'm not seeing the absence or value of an Item Filter as being exposed anywhere a script can get it. The list pointer is a public constant so exposing a copy to ash should not be too difficult. What's the motivation? What can you do with the lists that you can't do now? Are you willing to use the GUI to add and delete or are you hoping for script commands to do so? Do you need the list or would a proxy field combined with an iteration over Items work?

In Ye Olden Days, users would make what was essentially a feature request and project an attitude that they were entitled to demand that a volunteer dev do what they asked. Often the word "annoying" or variations thereof was used as in "you should do this because not doing it annoys me". Consequently requests that used "annoy" would be ignored by the people who could address the situation. First post, so you kind of get a pass, but expressing your request without that word increases the chances of it being considered.
 

Stewbeef

New member
I wasn't asking for it to get implemented. I was just saying I was frustrated I couldn't find a way to do it and was wondering if I was missing something. Sorry for the confusion and apologies for inadvertent offense.

It would be nice if a script could access the Mementos, Junk, and Singleton lists you can make in the GUI (nicer still if you could define your own custom-named lists that had gui support). Because some of that stuff is PVP-able, for instance, so I was making a script to move the stuff I care about to my closet. Then I realize there didn't seem a way to use the GUI-based lists in a script. I know there's some scripts out there for this sort of thing already, but I enjoy making my own (part of the reason I play).

I've since made a script and copied and modified the item_flags.txt into a map.

I realize this could probably all be done via a script that has web-based GUI instead, but I haven't made one of those yet. When starting out a list like these, a GUI is usually quicker than CLI, since it is often hard to specify exactly why you want to keep or junk X.

Unrelated: I did come across a bug while working on this and submitted a bug report for it.

Edit: I edited my original post to make my question clearer and to get rid of the "annoying" at the end.
 
Last edited:

Stewbeef

New member
Though, seems like I have to make a seperate list for some items for autoselling.

Gnoll Lips and the Book of Matches for instance, can't find a good way to test to see that they should be sold if they are on a "junk" list -- since some junk items are usable to get meat or items and that's preferable to autoselling.
 

fronobulax

Developer
Staff member
I am reasonably certain that if you pass file to map the name of a KoLmafia "internal" file, (such as item_flags) the map will be populated. The difficulty, as I recall, is defining the map correctly.

The "lists" don't seem to be an especially popular feature. I've never used them - having no interest in PvP and using other scripts to manage my stuff - and your initial question was not quite understood by at least one dev.

Most of the people who need "lists" get them by defining their own data file (and perhaps associated records) and using file_to_map and map_to_file. Most of the use cases for GUI support have been met by relay scripts.

All is forgiven about your inadvertent use of provocative vocabulary :)
 

lostcalpolydude

Developer
Staff member
I'm pretty sure you can't use file_to_map() on a file with no tabs, though. At least I know I've seen files with a random tab with a comment stating that it's only there for that reason.
 

Stewbeef

New member
Most of the people who need "lists" get them by defining their own data file (and perhaps associated records) and using file_to_map and map_to_file. Most of the use cases for GUI support have been met by relay scripts.

Yeah, that's what I ended up doing (and I've done it a lot with other things). I just haven't gotten around to delving into making relay scripts yet (that take input) so I have to rely on the CLI or editing the file for now.

I'm pretty sure you can't use file_to_map() on a file with no tabs, though. At least I know I've seen files with a random tab with a comment stating that it's only there for that reason.

This is correct as far as I can tell. I tried a few things.

The itemflags.txt file is just a list with 4 "headers" that start with ">" (so junk has a "> junk" line and then all the junk items one per line below).

There are no tabs or anything like that in it.
 
Last edited:
Top