Cli execute: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>StDoodle No edit summary |
||
Line 1: | Line 1: | ||
{{ | |||
#vardefine:name|cli_execute}}{{ | |||
#vardefine:return_type|boolean}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | |||
function_category=Miscellaneous| | |||
function1={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|string|command}}| | |||
p1desc={{Pspan|command}} is a cli command or commands to execute| | |||
}}| | |||
function_description=This function passes the parameter {{pspan|command}} on to KoLmafia's CLI, which will execute it as if it were typed in through the normal interface. This function will return true if the CLI command executed properly, and false if it was unable to do so (for example, trying to execute an adventuring command while drunk). Though it's considered a "best practice" to use built-in ASH functions when possible, there are some instances (such as "maximize") where no ASH function exists to handle what needs to be done, and this function allows access to such commands from within an ASH script.| | |||
{{ | |||
needscode=yes| | |||
cli_equiv=The function cli_execute() equivalents you!| | |||
}} |
Revision as of 23:37, 10 March 2010
needs(code_samples);
Function Syntax
boolean cli_execute(string command )
- command is a cli command or commands to execute
This function passes the parameter command on to KoLmafia's CLI, which will execute it as if it were typed in through the normal interface. This function will return true if the CLI command executed properly, and false if it was unable to do so (for example, trying to execute an adventuring command while drunk). Though it's considered a "best practice" to use built-in ASH functions when possible, there are some instances (such as "maximize") where no ASH function exists to handle what needs to be done, and this function allows access to such commands from within an ASH script.
CLI Equivalent
The function cli_execute() equivalents you!