StDoodle
Minion
StDoodle's Dungeon Parser v1.6
Requires KoLmafia r11552
Who's it For?
This script is primarily for those in charge of distributing basement loot for their clan. It can also be used in a similar manner to the raid log manager, but much slower to parse and without as many nifty features.
Note that the current version isn't all that "safe" about handling its use by players who can't access various clan & dungeon-related pages in KoL. Being unable to distro loot should be handled ok; it just won't ever get to that part if you aren't allowed to do that; but if you can't visit the basement at all or view the clan activity log, you may have major issues. I will eventually add support for handling these better.
What's it DO?
In a nutshell, it's a dungeon-agnostic dungeon parser. It looks at a currently-open dungeon log, and it parses each line against a data file. The first matching line from the data file will be used to add points to the player's total for whom the current activity line recognizes and / or mark that player as being eligible for loot. Note that the number of different "points" that can be tracked per dungeon is unlimited for the current instance; however, one category must be picked as being the "points" that are summarized and accumulated. This can be used to track things such as "how many vampires have been killed per player" or "what's the monster level adjustment from non-coms" to use a couple of Haunted Sorority House examples.
The script will display whatever information you want to track as either / or of a summary of totals in the current instance and per-player summaries in a table (complete with click-sorting headers). Once you've copy-pasted the previous summary forum post, it will display how much loot each player has and how much they want (by category, such as "Outfit" or "Nodules," all defined in the data-file), as well as their old tracked points and their running-totals.
Once the script sees that there is loot from the dungeon to distribute, it will also give drop-down menus similar to those in the clan basement main page for loot distribution. It will display the distribution rules for your clan & dungeon (again, defined in data file) as a reminder, and once you're done you can hit the "Distro!" button to have the script hand out the loot as specified. If not all loot has been assigned, you'll be asked if you're sure about going ahead.
Then, it will update all of the player info (running totals of points, loot acquired) and give a new forum post for copypasta as well as a summary of dungeon debts (again, defined in data file).
What else do I need?
StDoodle's Clan Management (http://kolmafia.us/showthread.php?8066) is required for this script to run; this is a clan plugin. That script has a large number of dependencies which it requires, so you'll need all of its support in place first.
Not all of the information is stored in the script (it's designed originally for use in Hardcore Nation, where multiple people are in charge of loot distribution; eventually, I have ideas for adding in automatic data-sharing, but it won't happen soon). You'll need to copy & paste certain information between some central source and this script. First, you'll need a place to store the "current & historical" information (who received what, and what the current point totals are); a php-based BBS (specifically, forums.hardcoreoxygenation.com) has been used as the test-case. Second, you need a place to keep track of dungeon debts if you charge for loot / participation.
You'll also need to define a bunch of stuff in a data file to figure how you want to track the dungeon, how you want to create debts, what your distro rules are, etc. This will be explained in detail in the following post. I will also upload a copy of HCN's data file for the Slime Tube, which is very simple and counts every turn spent in the tube as one point.
Finally, you'll need to configure the "registered_tabs.txt" data file for the Clan Management script such that you get a tab for the defined dungeon (also explained below). If you use the initialization script posted in the Clan Management thread, this should be set up for you.
For reference, my current "registered_tabs.txt" file contains the following (note; each entry for "order" should be unique).
Actually using this crazy thing...
Your best bet is probably just to run the bugger once all of the setup has been done. It's mostly self-explanatory once you have a dungeon definition data file in the right place (explained below).
For the most part, a properly configured data file will give enough directions such that you can find your own way around. Also, the script has tons of pop-up descriptions (via the "title" attribute) to help you out even more.
Honestly, I've had my head buried in this for so long that I can't fathom not understanding what it does; so if you try it out, and find yourself confused, please ask!
Version History
v1.6 Allow different types of tags for the forum summary post (see my post dated Oct. 17 2012)
v1.5 Fixed(?) bug where players with no previous forum post record had all of their "wants" at 0, instead of the dungeon's def_max
v1.4 Handle caching better and tweak some of the vprint() settings (9 will give debugging info now)
v1.03 Probably best if the forum post output is readable as input, eh?
v1.02 Fix what I broke while fixing the problem
v1.01 Fix distro function to give out last piece, not all but last
v1.0 Initial public release
Requires KoLmafia r11552
Who's it For?
This script is primarily for those in charge of distributing basement loot for their clan. It can also be used in a similar manner to the raid log manager, but much slower to parse and without as many nifty features.
Note that the current version isn't all that "safe" about handling its use by players who can't access various clan & dungeon-related pages in KoL. Being unable to distro loot should be handled ok; it just won't ever get to that part if you aren't allowed to do that; but if you can't visit the basement at all or view the clan activity log, you may have major issues. I will eventually add support for handling these better.
What's it DO?
In a nutshell, it's a dungeon-agnostic dungeon parser. It looks at a currently-open dungeon log, and it parses each line against a data file. The first matching line from the data file will be used to add points to the player's total for whom the current activity line recognizes and / or mark that player as being eligible for loot. Note that the number of different "points" that can be tracked per dungeon is unlimited for the current instance; however, one category must be picked as being the "points" that are summarized and accumulated. This can be used to track things such as "how many vampires have been killed per player" or "what's the monster level adjustment from non-coms" to use a couple of Haunted Sorority House examples.
The script will display whatever information you want to track as either / or of a summary of totals in the current instance and per-player summaries in a table (complete with click-sorting headers). Once you've copy-pasted the previous summary forum post, it will display how much loot each player has and how much they want (by category, such as "Outfit" or "Nodules," all defined in the data-file), as well as their old tracked points and their running-totals.
Once the script sees that there is loot from the dungeon to distribute, it will also give drop-down menus similar to those in the clan basement main page for loot distribution. It will display the distribution rules for your clan & dungeon (again, defined in data file) as a reminder, and once you're done you can hit the "Distro!" button to have the script hand out the loot as specified. If not all loot has been assigned, you'll be asked if you're sure about going ahead.
Then, it will update all of the player info (running totals of points, loot acquired) and give a new forum post for copypasta as well as a summary of dungeon debts (again, defined in data file).
What else do I need?
StDoodle's Clan Management (http://kolmafia.us/showthread.php?8066) is required for this script to run; this is a clan plugin. That script has a large number of dependencies which it requires, so you'll need all of its support in place first.
Not all of the information is stored in the script (it's designed originally for use in Hardcore Nation, where multiple people are in charge of loot distribution; eventually, I have ideas for adding in automatic data-sharing, but it won't happen soon). You'll need to copy & paste certain information between some central source and this script. First, you'll need a place to store the "current & historical" information (who received what, and what the current point totals are); a php-based BBS (specifically, forums.hardcoreoxygenation.com) has been used as the test-case. Second, you need a place to keep track of dungeon debts if you charge for loot / participation.
You'll also need to define a bunch of stuff in a data file to figure how you want to track the dungeon, how you want to create debts, what your distro rules are, etc. This will be explained in detail in the following post. I will also upload a copy of HCN's data file for the Slime Tube, which is very simple and counts every turn spent in the tube as one point.
Finally, you'll need to configure the "registered_tabs.txt" data file for the Clan Management script such that you get a tab for the defined dungeon (also explained below). If you use the initialization script posted in the Clan Management thread, this should be set up for you.
For reference, my current "registered_tabs.txt" file contains the following (note; each entry for "order" should be unique).
Code:
SLIMETUBE name SLIMETUBE
SLIMETUBE display SLIME TUBE DISTRO
SLIMETUBE script dungeon_parser.ash
SLIMETUBE parameter Slime Tube
SLIMETUBE actions 0 parse_history
SLIMETUBE actions 1 distro
SLIMETUBE actions 2 clear_history
SLIMETUBE actions 3 force_dis
SLIMETUBE actions 4 post_and_debt
SLIMETUBE actions 5 reset_cache
SLIMETUBE order 4
SLIMETUBE enabled true
Actually using this crazy thing...
Your best bet is probably just to run the bugger once all of the setup has been done. It's mostly self-explanatory once you have a dungeon definition data file in the right place (explained below).
For the most part, a properly configured data file will give enough directions such that you can find your own way around. Also, the script has tons of pop-up descriptions (via the "title" attribute) to help you out even more.
Honestly, I've had my head buried in this for so long that I can't fathom not understanding what it does; so if you try it out, and find yourself confused, please ask!
Version History
v1.6 Allow different types of tags for the forum summary post (see my post dated Oct. 17 2012)
v1.5 Fixed(?) bug where players with no previous forum post record had all of their "wants" at 0, instead of the dungeon's def_max
v1.4 Handle caching better and tweak some of the vprint() settings (9 will give debugging info now)
v1.03 Probably best if the forum post output is readable as input, eh?
v1.02 Fix what I broke while fixing the problem
v1.01 Fix distro function to give out last piece, not all but last
v1.0 Initial public release
Attachments
Last edited: