Inventory SPOILERZ

ckb

Minion
Staff member
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
Code:
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
 

Attachments

  • inventory-mods_04.ash
    8.7 KB · Views: 75
  • inventory-mods_05.ash
    8.7 KB · Views: 110
Last edited:

Theraze

Active member
Maybe trying
Code:
foreach it in get_inventory()
if you're just checking the inventory...
 

ckb

Minion
Staff member
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

Active member
Just equipped gear? Something like:
Code:
ashq foreach i in $slots[] print_html(equipped_item(i))
maybe?
 

ckb

Minion
Staff member
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

Member
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.
 
Last edited:

slyz

Developer
In Preferences -> Look & Feel -> Relay Browser, make sure "Enable user-scripted relay overrides" is checked.
 

slyz

Developer
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.
 
Last edited:

rlbond86

Member
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?
 

slyz

Developer
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:
PHP:
print( "Starting" );
This will print something in the gCLI, and it's a way to check the script was called.
 

rlbond86

Member
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

Developer
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".
 
Top