extract_item in combat

Grabuge

Member
extract_item says it can extract the number of item drop in combat but I can't figure out how to use it. How do you put the end combat result as a string?

Thanks

--Grab
 

Bale

Minion
I was attempting to answer this and found an unexpected change in mafia's functionality. You can follow the discussion here.
 

Bale

Minion
Provided you are using r14650 or later, the following information will help. Make sure you update your KoLmafia.

The last page load from a combat is saved and can be recalled by using the command run_combat() when you are not actually in a combat. So I recommend the extremely simple syntax of:
  • extract_items( run_combat() );

Here's an example of how it works:
Code:
[259] The Daily Dungeon
Encounter: sabre-toothed lime
Round 0: bale loses initiative!
You lose 11 hit points
Round 1: bale casts SAUCEGEYSER!
Round 2: sabre-toothed lime takes 221 damage.
Round 2: sabre-toothed lime takes 2 damage.
Round 2: bale wins the fight!
You acquire an item: Knob Goblin love potion
After Battle: From your little friend's face comes a wink and a gleam, / I'd say you and your Groose make a pretty good team!
You gain 40 Meat
You acquire an item: twist of lime
After Battle: With a sound that's a cross 'tween a squick and a shqueese, / your Groose, he produces a small glob of grease.
You acquire an item: groose grease
You gain 14 Muscleboundness
You gain 39 Enchantedness
You gain 11 Smarm
You gain 6 Soulsauce

[COLOR="#808000"]> ash extract_items( run_combat() )[/COLOR]

Returned: aggregate int [item]
groose grease => 1
Knob Goblin love potion => 1
twist of lime => 1

The love potion dropped from my pool skimmer, the grease was from my familiar and the twist of lime from the monster. Extract_items() reported them all.
 
Last edited:

digitrev

Member
This looks awesome. I've been debating writing some sort of automatic item-drop spading, and this should help greatly. Thanks!
 

Darzil

Developer
This looks awesome. I've been debating writing some sort of automatic item-drop spading, and this should help greatly. Thanks!

Bear in mind with automatic item drop spading you have to know what the +item drop (and pickpocket) rate was when the item dropped, not after the fight when in combat buffs drop off or other buffs have dropped off.
 

digitrev

Member
Bear in mind with automatic item drop spading you have to know what the +item drop (and pickpocket) rate was when the item dropped, not after the fight when in combat buffs drop off or other buffs have dropped off.

Yeah. I'm planning on writing a consult script that'll take a look at those numbers at the beginning of the fight (for pickpocketing) and at the end of the fight (for momentum, rave moves, handsome devil, etc...)
 

Bale

Minion
You're welcome, Grab. I'm glad that your question exposed a change of function in KoL that had broken our program. I don't use that much, but sometimes it is indispensable.
 
Top