Ashref: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Efilnikufecin
No edit summary
imported>Bale
mNo edit summary
 
(12 intermediate revisions by 7 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 " an 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 5449 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/>
string 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).