How to determine extra rollover adventures from equiment?

SBThief

New member
I'm writing a script to equip items with the highest available extra rollover adventures, and I am having difficulty finding out programatically how many extra adventures a particular item will give. I note that the website documents a proxy record for the item class that contains an "adventures" property, but for the several items I've looked at (General Sage's Lonely Diamond Club Jacket, Dead Guy's Watch), item.adventures is the null string.

What's the approved way of determining this?

If it matters, I'm on Windows 7, Java 1.8, and KoLmafia 17.12 at the latest build.
 

lostcalpolydude

Developer
Staff member
You would use numeric_modifier( item, "Adventures" ) to get that value. But you probably don't want to do that, since the maximizer (either the GUI or various commands) will do all the work for you.

The adventures proxy field is for food/booze/spleen that gives adventures.
 

SBThief

New member
I'm teaching myself scripting, and I thought it'd be useful to have a script that runs when I log off that will equip me for rollover, pulling from Hangk's as necessary since I generally run softcore.
 

Pazleysox

Member
Here's how I do it on the scripts that I've written:


int init = numeric_modifier( "adventures" );
print("Adventures " + init);

That will print out how many adventures you will receive from gear + skills + campground stuff.

You can bring it one further (I like to do this):
PHP:
        int count;
        int total;
	int init = numeric_modifier( "adventures" );
	if(get_property("_borrowedTimeUsed") == "true")
		{
		count = count - 20;
		}
	total = 40 + count + init + my_adventures();
print ("You will receive " + total + " adventures after rollover");
 
All that does is tell you how many adventures your current setup will give you, which is nice for verification, but not all that helpful for making the script in the first place.
But as lost mentioned, you don't have to write a full script for this, since the modifier maximizer can do this just fine for you, all you have to do is put: 'maximize adv' as a cli command.

Or if you want something a bit more complex, my logout script uses: 'cli_execute("maximize adv, "+ pvpValue+" pvp fights, switch tot, switch disembodied hand");'
This way I get to specify how much I value pvp fights compared to adventures, and it will include the trick-or-treating tot and disembodied hand on top of whatever familiar I'm currently using, and switch to them when appropriate.
 

Pazleysox

Member
This script that I wrote will probably do what he's looking to do then. It will show what gear a player has, and tell how many bonus turns it will give. It does not pull, or equip the gear however.
 

SBThief

New member
I have my script pretty much working, thanks for everyone's help. One thing I'm not understanding though: I have the "Hairpiece On Fire", good for 4 extra adventures at rollover. The description contains: "NOTE: This item is too old to use on your current path" yet can_equip() returns true. How can I discover that I really *can't* equip this?
 
Top