Are these functions documented anywhere? I'm interested in storing data inbetween calls to a script, and this could potentially allow me to do that in a relatively clean way, but I need to know exactly how they're used and exactly what issues might arise as a result.use set_property() and get_property() to save the variable as a preference.
Searching for set_property there yields nothing but red links.Yep, they are documented, but unfortunately not very thouroughly (yet?).
KoLmafia Wiki
But since some $%&§$%§& morons put some attacking html.scripts there you might have to have to ignore some warnings to get there (depending on your browser).
Cheers,
ki77bot.
time_soaked_today = to_int( get_property("_hotTubSoaks") );
if( get_property("switchEquipment") == "false")
set_property("switchEquipment", "true");
According to ashref, set_property() is a void. I can't really think of any sensible return value for it in any case.
if ( set_property( "_prop", "true" ) != "true" )
{
... executed only if _prop was not true. It now is true.
}
item goodnightdrink= something;//whatever you want to drink on good night
set_property("ki77bot's good night drink", goodnightdrink.to_string());
item goodnightdrink= get_property("ki77bot's good night drink").to_item();
overdrink(1, goodnightdrink);