DCQuest

fronobulax

Developer
Staff member
DCQuest 1.5
DCPrune 1.3.1


DCQuest is an information gathering script for the Display Case completest. It looks at every displayable item that your version of Kolmafia knows about and writes tab delimited files with some annotation in the data subdirectory.

EDIT: Major Update - see https://kolmafia.us/threads/dcquest.3640/page-3#post-171647


DC_"YourUserName".txt has two columns. The first is the name of an item that you do not have in your display case. The second is either:
  • A number that is an historical mall price for the item
  • "Gift" for an item that is available in the Gift Shop
  • "Not in Mall" for an item that can be sold, but is not presently in the Mall
  • "Work" for an item that can be obtained by some other means such as ascending and adventuring

DCQJW_"YourUserName".txt has six columns. The first is the name of an item you do have in your display case. The second is how many of those items you have in the display case. Next is where your collection ranks according to the collections database at Jicken Wings, with zero meaning you don't rank. Next is the number of items the next rank has followed by the number of items the #1 rank has. Last is a yyyymmdd string for when the collections database was checked.

Both of these files are tab delimited and can be viewed and manipulated in a spreadsheet. However, it is not recommended that changes be made to DCQJW_"YourUserName".txt in case such changes make the file unreadable by the scripts. DC_"YourUserName".txt is only written, never read, by these scripts.

The script will emit a line into the gCLI window if an item is available to you but not in your display case. Finally it will check for your rank in the Jicken Wings "percent complete of displayable items" leaderboard. A known issue is that the first run of a session will often claim (incorrectly) that you are unranked, whereas subsequent runs will correctly show the rank.

DCQuest burns no adventures and moves no items (but see DCPrune, below). The most likely use case is to manipulate the data files as spreadsheets to plan shopping trips or adventure strategies.

As currently configured, it can take a long time to run with 15 minutes being reasonable for a full display case.

The script contains code originally written by zarqon although it looks like I now get to maintain it. Thanks to zarqon and others who put up with my n00b questions.

DCPrune works with DCQuest, using the DCQJW_"YourUserName".txt that it creates. It looks for items in your display case that you have more than one of but your collection does not reach a particular rank on the leaderboards. It then moves all but one of those items into your closet. If your closet is cluttered then this will not be helpful, but if your closet is relatively empty then it should be fairly easy to identify the items to sell, pulverize or otherwise dispose of.

Note that these scripts all require zlib. DCQuest also requires datelib. The use of a zlib variable editor such as this or this is highly recommended but not required.

Thank you.

Release V1.01
  • Fix typo that only recognized creatable items if more than one could be created
  • Pulled write of map outside of loop
  • Added counter of meat needed to buy missing items from mall
  • Fixed several typos in comments
  • Fixed error in checking for versions
Release V1.02
  • Fixed problem when all collections are tied for #1
  • Added verbosity triggered status updates
Release V1.03
  • Added code to check for % complete leaderboard
  • Status messages for control options
  • Added DCPrune
Release V1.1
  • Reorganized DCQuest code
  • Prompt for singleton checking in DCQuest
  • DCPrune hardcoded to only consider ranks of 250 or less as keepers.
  • Fixed bug in DCPrune where rank check was wrong.
Release V1.2
  • First release of DC2Wiki
  • Made threshold a zlib variable in DCPrune
  • Made several parameters zlib variables in DCQuest.
  • Tweaked "use cache" decision making in DCQuest.
Release 1.3
  • Dropped "v" from version identifier.
  • Changed filenames to conform with <script><user> naming convention.
  • Reduced cache file writes for improved performance on slow devices such as thumb drives.
  • Delete entries from cache if item no longer in DC.
  • Add entries to cache when there is no entry and exactly one in DC. Do this without regard to CHECK ALL flag but only for 25 items per invocation of DCQuest.
DCQuest Release 1.4
Tweaked caching a bit. It is now usually true that all cache entries have a corresponding item in the display case and all items in the display case have a corresponding cache entry. Entries older than DCQuest_maxAge will be unconditionally removed from the cache. The number of singletons, with no cache entry, that are updated by hitting JickenWings has been throttled so that the script does not run for hours and make thousands of hits when run against a well stocked display case.

DCPrune 1.3.1 - Fixed cut and paste typo in version checking.

22 OCT 2012 - Removed DC2Wiki. See thread for reasons.

Note - if you upgrade to 1.3 then you probably want to delete "YourUserName"_DC.txt and rename "YourUserName"_JWDC.txt to be DCQJW_"YourUserName".txt. If you were running DCQuest circa September 2012 when JickenWings was unavailable for several days you should upgrade to 1.4 so bad data is eventually replaced or delete DCQJW_"YourUserName".txt. and run 1.4 so that bad data is quickly replaced. Bad data in this case is a cache entry signifying unranked for every item checked while JickenWings was down.

05 AUG 2013

DCQuest now maintained in SVN.
Code:
svn checkout https://svn.code.sf.net/p/kolmafiascripts/dcq/code/

1.5 tweaks cache management just a little. Biggest change is moving to SVN.
 

Attachments

  • DCPrune.ash
    1.7 KB · Views: 139
Last edited:

icon315

Member
The script is giving wrongfull Info on the update message.

Code:
string THIS_VERSION = "1.00";

SHould be
Code:
string THIS_VERSION = "[B]v[/B]1.00";

This is the Message given

Code:
[FONT="Arial"][SIZE="6"][COLOR="Red"]New Version of DCQuest Available: v1.00[/COLOR][/SIZE][/FONT]
Upgrade DCQuest from[B] 1.00[/B] to [B]v1.00[/B] here: http://kolmafia.us/showthread.php?t=3640
 
Last edited:

fronobulax

Developer
Staff member
Fixed. Thank you. Version unchanged.

Updating was one thing I could not test until I actually made this thread.
 

fronobulax

Developer
Staff member
For reasons as yet undiagnosed, sometimes DCQuest reports that a user does not rank on the Jicken Wings leaderboard when in fact the user does rank. This may be related to a timeout in fetching the Jicken Wings page or the sheer size of the returned results. The workaround is to re-run the script, since it has never been observed to fail twice in a row. Investigation continues.
 

StDoodle

Minion
If it's related to a timeout, you may want to check that the returned string length is a reasonable value right after your visit_url() call, and if not, perhaps wait() for a short bit, then try again. Abort if you still don't have a string.

If it's a size-of-string issue, I could be wrong, but it might be a little safer to use a buffer. But again, I could be very wrong. (Both because buffer may have the same limits, and because visit_url() returns a buffer anyway, and I'm not sure when it's converted to a string, exactly.)
 

fronobulax

Developer
Staff member
Thanks. I had a version that checked the return string length and re-visited if it was zero. It still failed to find and I didn't bother to see why. I also turned on the debug log and, of course, it didn't fail. Given the size of the page I probably should consider a buffer. I tend to avoid them for no rational reason. For performance reasons buffer.add(stuff) is faster than buffer += stuff in almost every language/implementation I can think of but I really like using the plus sign as the concatenation operator.
 

fronobulax

Developer
Staff member
Just to bump the thread...

New versions available. See first post.

Jicken Wings is updating their database but the updates occur irregularly.
 

icon315

Member
Function 'abs( int )' defined multiple times (zlib.ash, line 14)

i realize that it says zlib, but this never happened on the last version
 

Theraze

Active member
Does the ASH language allow for something similar to this C language example?
Code:
#if !defined(value)
<definition>
#endif
 

heeheehee

Developer
Staff member
No, but I'm pretty sure the latest version of DateLib imports ZLib.ash to avoid this problem. Redownload, I guess?
 

icon315

Member
you could do something like
Code:
if ("value" != "")
string value = definitions
not 100% on that though
 

heeheehee

Developer
Staff member
The problem here is that abs() is a function defined in multiple places. Also, "value" will never equal "", so that won't work. The best solution would be a way to check if a function is already defined, then decide what to do from there. However, ASH doesn't support this yet.
 

fronobulax

Developer
Staff member
There's a conflict between zlib and datelib: both define an abs() function.

Thanks. I had forgotten about that. For the moment, just delete the definition of abs in datelib. I suppose I should ask heeheehee to consider using zLib or, better yet, see if zarqon and heeheehee would consider merging datelib into zLib.

Update: Just DL'd datelib and it looks as if heeheehee is now using zLib. I suspect the solution is to update datelib.
 
Last edited:

heeheehee

Developer
Staff member
As mentioned, I changed DateLib to require ZLib (as per your request a month ago), so if you're using the most recent version, you won't run into this problem.
 

fronobulax

Developer
Staff member
Necrobump.

Scripts updated, primarily to follow <script><user> naming convention for data files, but also including some tweaks so that the cache file (DCQJW...) is a much closer representation of DC contents. Items that are not in the DC will be deleted from the cache and one way or another all items in the DC will get a cache entry eventually.
 

fronobulax

Developer
Staff member
According to this the JickenWings database is down for a bit while they change hosts. DCQuest currently decides that you don't rank and that can be a problem if DCPrune, which depends upon the rankings, is run. My recommendation would be to not run DCPrune at all until the database is reliably available and, once it is, to delete DCQJW_<username>.txt and run DCQuest when it can run for "a while". I don't know if I will try and detect the difference between not being ranked and the site not having the data or not. Seems like a niche case. I am tweaking ways to invalide and regenerate portions of the cahce, however, so there may be an update eventually.
 

fronobulax

Developer
Staff member
All versions cache an unranked entry if there is a problem accessing JuckenWings. v1.4 is better at cleaning those out of the cache and eventually updating them with valid data.
 

fronobulax

Developer
Staff member
Updating DCQuest uncovered a cut and paste typo in version checking so that has been fixed in DCPrune.
 
Top