Run turn: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>AlbinoRhino
Created page with "{{ #vardefine:name|run_turn}}{{ #vardefine:return_type|buffer}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| return_type={{#var:return_type}..."
 
imported>AlbinoRhino
mNo edit summary
 
Line 15: Line 15:
function_description=Will work as [[run_combat|run_combat()]] or [[run_choice|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|visit_url()]].</p><p>
function_description=Will work as [[run_combat|run_combat()]] or [[run_choice|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|visit_url()]].</p><p>


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 choice results page into the CLI.|
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.|


code1={{CodeSample|
code1={{CodeSample|

Latest revision as of 05:43, 28 October 2019

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()