Ashref: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Alhifar
m Fixed copy-paste error
imported>Bale
mNo edit summary
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[ashref]]
{{DISPLAYTITLE:ashref (CLI)}}


AshRef is not an actual ash function, it is a cli function.  
Technically, "ashref" is a CLI command, but it's one of particular use for ASH scripting.  


Enter "ashref" into the Graphical cli with no parameters will display a list of all available ASH scripting functions.
Entering "ashref" into the CLI with no parameters will display a list of all available ASH scripting functions.


Entering "ashref " and a partial command name will display all commands matching the partial command name entered.
Entering "ashref [string]" with a partial command name in place of "[string]" will display all commands matching the partial command name entered.


Note that calling ashref with a datatype as your parameter will return functions taking that datatype as a parameter, but the return type is ignored. For example, "ashref string" would list the function [[user_confirm|user_confirm( string )]] (which returns a boolean), but not the function [[to_url|to_url( location )]] (which returns a string).


==Example==
[[Category:CLI Commands]][[Category:Scripting]]
Entering "ashref string" into the GCLI in subversion 6192 yields:<Br/>
 
<TABLE CELLPADDING=1 cellspacing=3 BORDER=1px>
<tr><td>
void enable( string )<br/>
void disable( string )<br/>
boolean user_confirm( string )<br/>
void logprint( string )<br/>
void print( string )<br/>
void print( string, string )<br/>
void print_html( string )<br/>
void abort( string )<br/>
boolean cli_execute( string )<br/>
buffer load_html( string )<br/>
void write( string )<br/>
void writeln( string )<br/>
string form_field( string )<br/>
buffer visit_url( string )<br/>
string to_string( any )<br/>
item to_item( string )<br/>
class to_class( string )<br/>
stat to_stat( string )<br/>
skill to_skill( string )<br/>
effect to_effect( string )<br/>
location to_location( string )<br/>
familiar to_familiar( string )<br/>
monster to_monster( string )<br/>
string today_to_string(  )<br/>
string [int] session_logs( string, int )<br/>
boolean outfit( string )<br/>
boolean have_outfit( string )<br/>
boolean contains_text( string, string )<br/>
int extract_meat( string )<br/>
int [item] extract_items( string )<br/>
int length( string )<br/>
int index_of( string, string )<br/>
int index_of( string, string, int )<br/>
int last_index_of( string, string )<br/>
int last_index_of( string, string, int )<br/>
string substring( string, int )<br/>
string substring( string, int, int )<br/>
string to_lower_case( string )<br/>
string to_upper_case( string )<br/>
matcher create_matcher( string, string )<br/>
buffer replace_string( buffer, string, string )<br/>
buffer replace_string( string, string, string )<br/>
string [int] split_string( string )<br/>
string [int] split_string( string, string )<br/>
string [int, int] group_string( string, string )<br/>
void chat_reply( string )<br/>
string url_encode( string )<br/>
string url_decode( string )<br/>
string get_property( string )<br/>
void set_property( string, string )<br/>
boolean file_to_map( string, aggregate )<br/>
boolean file_to_map( string, aggregate, boolean )<br/>
float numeric_modifier( string )<br/>
boolean boolean_modifier( string )<br/>
</td></tr>
</table>

Latest revision as of 22:31, 10 November 2010


Technically, "ashref" is a CLI command, but it's one of particular use for ASH scripting.

Entering "ashref" into the CLI with no parameters will display a list of all available ASH scripting functions.

Entering "ashref [string]" with a partial command name in place of "[string]" will display all commands matching the partial command name entered.

Note that calling ashref with a datatype as your parameter will return functions taking that datatype as a parameter, but the return type is ignored. For example, "ashref string" would list the function user_confirm( string ) (which returns a boolean), but not the function to_url( location ) (which returns a string).