PDA

View Full Version : Inventory SPOILERZ



ckb
09-06-2011, 10:49 PM
After looking at lostcalpolydude's inventory.ash quality coloring and BCC's bUMRATS relay stuff and some of the details around KolMafia's modifier functions, I deciced to create a spoilerific inventory helper.

This adds nearly everything KolMafia knows about every item into the Relay browser inventory pages. This is a lot of stuff, so it is slow, but very useful. I have only tested this in an aftercare setting with a huge inventory, so it may not matter so much if your inventory is small.

It uses a
foreach it in $items[] loop instead of a regex search because I could not find a reliable way in a regex matcher to account for and list ALL the items in inventory without either missing some weird ones or getting too much and running into errors in the to_item(string) command. This way it will also account for strange item names in the future as long as Mafia is updated.

Thie borrows (steals) some keen code from lostcalpolydude and BCC and Veracity. I probably would could not have done it on my own without their previous work.

Download, rename to "inventory.ash", and copy into relay folder.
04 - Initial version
05 - remove bolding of item descriptions

ckb

Theraze
09-06-2011, 11:07 PM
Maybe trying
foreach it in get_inventory()if you're just checking the inventory...

ckb
09-07-2011, 03:57 PM
This mostly works Theraze, except for the equipment you are holding (unless it is also in your inventory). I checked with a multi and this is much faster when your inventory is smaller.
However, now that the $item[none] bug is fixed, I might try a matcher again.

ckb

Theraze
09-07-2011, 05:41 PM
Just equipped gear? Something like:
ashq foreach i in $slots[] print_html(equipped_item(i))maybe?

charred
09-07-2011, 07:19 PM
i like it, good job. very handy

ckb
09-14-2011, 03:59 PM
Minor change made to make the description of items NOT bolded. I think this makes them easier to read and take up less space.
I have decideed ti keep the foreach it in $items[] because it does such a great job of finding everything and is not nearly as slow during ascention when your inventory is small.
Still todo: get those identified ! potions to display correctly.

ckb

rlbond86
03-22-2012, 06:25 PM
Am I doing something wrong? It's not working at all. I renamed the file.

slyz
03-22-2012, 08:03 PM
Did you put it in Mafia's /relay folder?

rlbond86
03-24-2012, 08:05 PM
yeah, inventory.sh is in the /relay folder. Nothing is colored in the relay browser :(

I'm not sure the script is even being run. I added a line "print("Test");" but nothing shows in the graphical CLI. Though, I've not written a relay browser script so I don't know if that would work.

slyz
03-24-2012, 08:08 PM
In Preferences -> Look & Feel -> Relay Browser, make sure "Enable user-scripted relay overrides" is checked.

rlbond86
03-24-2012, 08:31 PM
It was unchecked, but checking it has not changed anything.

fronobulax
03-24-2012, 08:32 PM
yeah, inventory.sh is in the /relay folder. Nothing is colored in the relay browser :(


If that was not a typo it should be inventory.ash.

rlbond86
03-24-2012, 08:37 PM
sorry, that was a typo, it's inventory.ash. And relayAllowsOverrides is set to true :/

slyz
03-24-2012, 08:42 PM
Restart Mafia after checking it?

EDIT: I just tried the script. It takes a looong time to run, so simply be patient after clicking the inventory link.

rlbond86
03-24-2012, 08:48 PM
I don't think it's the script. I tried a different inventory script and it didn't run either. I'm not sure why, but for some reason KoLmafia isn't running it. Like I said, I checked the override script option. I'm using the most recent .exe build, r10806, if that helps. Is there a way to confirm that the script is actually running?

rlbond86
03-24-2012, 08:50 PM
Oh, actually quitting KoLmafia seemed to fix it! Thanks.

slyz
03-24-2012, 09:24 PM
Is there a way to confirm that the script is actually running?
In case you still want to know, edit the script in a non-formatting text editor (notepad, not word), and add a print() at the top, like this:


print( "Starting" );

This will print something in the gCLI, and it's a way to check the script was called.

rlbond86
03-27-2012, 09:37 PM
Ok, something weird has happened. My equipment section's descriptions are all messed up. I've posted a few below.

stone baseball cap
Damage Reduction: 10.0, Muscle: -10.0, Weapon Damage: 15.0, Effect: 1xVolley, cap 48
[equip] (Power: 195)
wool hat
Cold Resistance: 2.0, Damage Absorption: 20.0, Effect: 1xLep, cap 43
[equip] (Power: 175)

beer helmet
Maximum MP: 40.0, Effect: 0.5xBarrr, 1xFairy, cap 42
[equip] (Power: 170)
reinforced beaded headband
Maximum HP: 40.0, Effect: 0.5xBarrr, 1xFairy, cap 42
[equip] (Power: 170)

dwarvish war helmet
Effect: atk, 1xFairy, cap 41
[equip] (Power: 165)

mesh cap
Moxie: -5.0, Muscle: 15.0, Effect: atk, 1xVolley, cap 41
[equip] (Power: 165)

star hat
Maximum MP: 30.0, Effect: 0.5xVolley, 0.5xPotato, cap 41
[equip] (Power: 165)

black helmet
Maximum HP: 30.0, Effect: 1xFairy, cap 40
[equip] (Power: 160)

grungy bandana
Sleaze Damage: 10.0, Stench Damage: 10.0, Effect: 1xVolley, 0.5xPotato, cap 37
[equip] (Power: 150)

rave visor
Maximum MP: 20.0, Raveosity: 2.0, Effect: 1xVolley, 1.5xPotato, cap 37
[equip] (Power: 150)

wolf mask
Moxie: -5.0, Muscle: 4.0, Effect: 1xBarrr, HP regen, cap 37
[equip] (Power: 150)

Mohawk wig
Weapon Damage: 10.0, Effect: 1xPotato, 1xGhuol, cap 35
[equip] (Power: 140)

slyz
03-27-2012, 09:42 PM
What is messed up exactly?

EDIT: Oh, I see, the "Effect: 1xVolley, 1.5xPotato, cap 37" modifiers. That's the modifiers for hats/pants used on a hatrack/pantsrack. It should say "Familiar Effect" instead of "Effect".

rlbond86
03-27-2012, 11:17 PM
Oh, so that's what that is. Is there a way to disable that?

slyz
03-28-2012, 06:40 AM
After looking at it a little more, it looks like a Mafia bug (the script asks for the "Effect" modifier, and Mafia returns the "Familiar Effect" modifier).

I'll see what I can do later, or I'll post a bug report so someone else can have a look.

rlbond86
03-28-2012, 02:58 PM
Hey Slyz, I am really digging this script. I made a few modifications which you might be interested in:

1. Food/booze/spleen items now show adv/fullness (or adv/drunk or adv/spleen)
2. To save space, adventure and statgain averages are shown instead of ranges (e.g., 8-11 shows 9.5 instead, 10-12 shows 11.0 instead). It's easy to tell when this has been done because an averaged quantity will always have a decimal place.

Take a look, steal anything you like.

6126