Adv1: Difference between revisions
Jump to navigation
Jump to search
imported>Bale mNo edit summary |
Explain return value better |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 16: | Line 16: | ||
p1desc={{Pspan|place}} is the adventuring location.| | p1desc={{Pspan|place}} is the adventuring location.| | ||
p2desc={{Pspan|turnsUsed}} overrides the normal number of adventures that are expected to be consumed at this location, or -1 can be passed to use the default. Specifically, 0 will prevent any counters from triggering - of course, if an adventure actually is consumed, any counters that you kept from triggering will be lost.| | p2desc={{Pspan|turnsUsed}} overrides the normal number of adventures that are expected to be consumed at this location, or -1 can be passed to use the default. Specifically, 0 will prevent any counters from triggering - of course, if an adventure actually is consumed, any counters that you kept from triggering will be lost.| | ||
p3desc={{Pspan|filterFunc}} is the name of a combat filter function defined elsewhere in your script, with the same behavior as in the 3-paramater version of [[adventure]](). An empty string can be passed to use your battle action or CCS as normal.}}| | p3desc={{Pspan|filterFunc}} is a macro or the name of a combat filter function defined elsewhere in your script, with the same behavior as in the 3-paramater version of [[adventure]](). An empty string can be passed to use your battle action or CCS as normal.}}| | ||
function_description=This will adventure exactly once in the specified {{pspan|place}} (even if it took no turns), although it will follow chained choice adventures for as long as you have preset options.</p> | function_description=This will adventure exactly once in the specified {{pspan|place}} (even if it took no turns), although it will follow chained choice adventures for as long as you have preset options.</p> | ||
<p>This function | <p>If {{Pspan|filter}} contains a semicolon it will use {{Pspan|filter}} as a macro.</p> | ||
<p>This function returns <code>true</code> if KoLmafia adventured successfully. It will return <code>false</code> if it cannot adventure for any reason:</p> | |||
code1={{CodeSample| | * Not enough adventures | ||
* Location is unavailable | |||
* You are falling-down drunk | |||
* If the adventure was successful, but KoLmafia was put into a PENDING state. This indicates that we might be done adventuring in this location, and usually occurs because we successfully finished a quest-related action in that zone. | |||
<p><!-- Dummy paragraph to prevent {{CodeSample}} from being merged into the list --></p> | |||
|code1={{CodeSample| | |||
title=Code Sample| | title=Code Sample| | ||
description=Adventures 1 time at the Slime Tube. If an adventure takes no turns, possibly because the Gall Bladder was already squeezed, that adventure will still count. Counters will trigger as normal.| | description=Adventures 1 time at the Slime Tube. If an adventure takes no turns, possibly because the Gall Bladder was already squeezed, that adventure will still count. Counters will trigger as normal.| | ||
Line 30: | Line 37: | ||
</syntaxhighlight>}}| | </syntaxhighlight>}}| | ||
see_also={{SeeAlso|adventure}}| | see_also={{SeeAlso|adventure|run_combat|run_choice}}| | ||
cli_equiv=None - "adv" will always try adventuring again if an adventure took no turns.| | cli_equiv=None - "adv" will always try adventuring again if an adventure took no turns.| | ||
}} | }} | ||
[[Category:Adventuring]] | [[Category:Adventuring]] |
Latest revision as of 06:45, 7 July 2021
Function Syntax
boolean adv1(location place ,int turnsUsed ,string filterFunc )
- place is the adventuring location.
- turnsUsed overrides the normal number of adventures that are expected to be consumed at this location, or -1 can be passed to use the default. Specifically, 0 will prevent any counters from triggering - of course, if an adventure actually is consumed, any counters that you kept from triggering will be lost.
- filterFunc is a macro or the name of a combat filter function defined elsewhere in your script, with the same behavior as in the 3-paramater version of adventure(). An empty string can be passed to use your battle action or CCS as normal.
This will adventure exactly once in the specified place (even if it took no turns), although it will follow chained choice adventures for as long as you have preset options.
If filter contains a semicolon it will use filter as a macro.
This function returns true
if KoLmafia adventured successfully. It will return false
if it cannot adventure for any reason:
- Not enough adventures
- Location is unavailable
- You are falling-down drunk
- If the adventure was successful, but KoLmafia was put into a PENDING state. This indicates that we might be done adventuring in this location, and usually occurs because we successfully finished a quest-related action in that zone.
Code Sample
Adventures 1 time at the Slime Tube. If an adventure takes no turns, possibly because the Gall Bladder was already squeezed, that adventure will still count. Counters will trigger as normal.
adv1($location[slime tube], -1, "");
CLI Equivalent
None - "adv" will always try adventuring again if an adventure took no turns.