Set property

From Kolmafia
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Function Syntax

void set_property(string prop ,string value )

  • prop is the property to set
  • value is the value to set the property to

Looks for a global or appropriate user preference from the saved files (found in your "Settings" directory) and if it finds one that matches, it overrides its value with value. If a match is not found in your existing preferences for prop, it will create a property with that name and set it to value.

Code Samples

The following sets the choice adventures in the Castle of the Sky Top Floor before farming there.

//Castle Top floor
set_property("choiceAdventure677", 4);
set_property("choiceAdventure675", 1);
set_property("choiceAdventure678", 4);
set_property("choiceAdventure676", 1);
adventure(5, $location[The Castle in the Clouds in the Sky (Top Floor)]);

For a full list of choice adventures see Choice Adventures.

CLI Equivalent

The CLI command "set" works similarly.

See Also

get_property()

Special

You can set a custom property that automatically gets its value cleared each new KoL day by prefixing it with an underscore.