Run turn

From Kolmafia
Jump to navigation Jump to search

Function Syntax

buffer run_turn()

Will work as run_combat() or run_choice(-1) depending on whether you are in combat or in a choice. Proceeds to run a choice or combat, using your current KoLmafia settings. This function returns the HTML from the page (not just what is displayed, but all markup). Most commonly used to finish up adventures started via visit_url().

Typing "ashq run_turn()" into the CLI will finish up the adventure for you using your KoLMafia settings. Note that "ashq" is necessary rather than "ash" to avoid spewing the entire results page into the CLI.

Code Sample

This code converts your current location to its url and initiates a turn there. Whether a choice or combat, it will complete the adventure and capture the page text.

void run_adv(location place)
{
   string page_text = to_url(place).visit_url();
   page_text = run_turn();
}
run_adv(my_location());

See Also

adventure() | adv1() | visit_url() | run_combat() | run_choice() | my_location()