Ashref: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Alhifar
→‎Example: updated to 6192
imported>Bale
mNo edit summary
 
(10 intermediate revisions by 6 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/>
void abort(  )<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(  )<br/>
buffer visit_url( string )<br/>
void wait( int )<br/>
string to_string( any )<br/>
boolean to_boolean( any )<br/>
int to_int( any )<br/>
float to_float( any )<br/>
item to_item( string )<br/>
item to_item( int )<br/>
class to_class( string )<br/>
stat to_stat( string )<br/>
skill to_skill( int )<br/>
skill to_skill( string )<br/>
skill to_skill( effect )<br/>
effect to_effect( int )<br/>
effect to_effect( string )<br/>
effect to_effect( skill )<br/>
location to_location( string )<br/>
familiar to_familiar( int )<br/>
familiar to_familiar( string )<br/>
monster to_monster( string )<br/>
slot to_slot( item )<br/>
string to_url( location )<br/>
string today_to_string(  )<br/>
int moon_phase(  )<br/>
int moon_light(  )<br/>
stat stat_bonus_today(  )<br/>
stat stat_bonus_tomorrow(  )<br/>
string [int] session_logs( int )<br/>
string [int] session_logs( string, int )<br/>
boolean adventure( int, location )<br/>
void add_item_condition( int, item )<br/>
boolean buy( int, item )<br/>
boolean create( int, item )<br/>
boolean use( int, item )<br/>
boolean eat( int, item )<br/>
boolean drink( int, item )<br/>
boolean put_closet( int, item )<br/>
boolean put_shop( int, int, item )<br/>
boolean put_stash( int, item )<br/>
boolean put_display( int, item )<br/>
boolean take_closet( int, item )<br/>
boolean take_storage( int, item )<br/>
boolean take_display( int, item )<br/>
boolean take_stash( int, item )<br/>
boolean autosell( int, item )<br/>
boolean hermit( int, item )<br/>
boolean retrieve_item( int, item )<br/>
int [item] get_inventory(  )<br/>
boolean is_npc_item( item )<br/>
boolean is_tradeable( item )<br/>
item daily_special(  )<br/>
boolean refresh_stash(  )<br/>
int available_amount( item )<br/>
int item_amount( item )<br/>
int closet_amount( item )<br/>
int creatable_amount( item )<br/>
int [item] get_ingredients( item )<br/>
int storage_amount( item )<br/>
int display_amount( item )<br/>
int shop_amount( item )<br/>
int stash_amount( item )<br/>
int pulls_remaining(  )<br/>
int stills_available(  )<br/>
boolean have_mushroom_plot(  )<br/>
boolean refresh_status(  )<br/>
boolean restore_hp( int )<br/>
boolean restore_mp( int )<br/>
string my_name(  )<br/>
string my_id(  )<br/>
string my_hash(  )<br/>
boolean in_muscle_sign(  )<br/>
boolean in_mysticality_sign(  )<br/>
boolean in_moxie_sign(  )<br/>
boolean in_bad_moon(  )<br/>
class my_class(  )<br/>
int my_level(  )<br/>
int my_hp(  )<br/>
int my_maxhp(  )<br/>
int my_mp(  )<br/>
int my_maxmp(  )<br/>
stat my_primestat(  )<br/>
int my_basestat( stat )<br/>
int my_buffedstat( stat )<br/>
int my_meat(  )<br/>
int my_adventures(  )<br/>
int my_turncount(  )<br/>
int my_fullness(  )<br/>
int fullness_limit(  )<br/>
int my_inebriety(  )<br/>
int inebriety_limit(  )<br/>
int my_spleen_use(  )<br/>
int spleen_limit(  )<br/>
boolean can_eat(  )<br/>
boolean can_drink(  )<br/>
int turns_played(  )<br/>
boolean can_interact(  )<br/>
boolean in_hardcore(  )<br/>
boolean have_skill( skill )<br/>
int mp_cost( skill )<br/>
int turns_per_cast( skill )<br/>
int have_effect( effect )<br/>
boolean use_skill( int, skill )<br/>
boolean use_skill( int, skill, string )<br/>
buffer attack(  )<br/>
buffer steal(  )<br/>
buffer runaway(  )<br/>
buffer use_skill( skill )<br/>
buffer throw_item( item )<br/>
buffer throw_items( item, item )<br/>
buffer run_combat(  )<br/>
boolean can_equip( item )<br/>
boolean equip( item )<br/>
boolean equip( slot, item )<br/>
item equipped_item( slot )<br/>
boolean have_equipped( item )<br/>
boolean outfit( string )<br/>
boolean have_outfit( string )<br/>
familiar my_familiar(  )<br/>
boolean have_familiar( familiar )<br/>
boolean use_familiar( familiar )<br/>
item familiar_equipment( familiar )<br/>
int familiar_weight( familiar )<br/>
int weapon_hands( item )<br/>
string item_type( item )<br/>
stat weapon_type( item )<br/>
int get_power( item )<br/>
void council(  )<br/>
int current_mcd(  )<br/>
boolean change_mcd( int )<br/>
boolean have_chef(  )<br/>
boolean have_bartender(  )<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/>
buffer append( buffer, string )<br/>
buffer insert( buffer, int, string )<br/>
boolean replace( buffer, int, int, string )<br/>
buffer delete( buffer, int, int )<br/>
buffer append_tail( matcher, buffer )<br/>
buffer append_replacement( matcher, buffer, string )<br/>
matcher create_matcher( string, string )<br/>
boolean find( matcher )<br/>
boolean start( matcher )<br/>
boolean end( matcher )<br/>
boolean group( matcher )<br/>
boolean group( matcher, int )<br/>
boolean group_count( matcher )<br/>
string replace_first( matcher, string )<br/>
string replace_all( matcher, string )<br/>
matcher reset( matcher )<br/>
matcher reset( matcher, 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/>
boolean entryway(  )<br/>
boolean hedgemaze(  )<br/>
item guardians(  )<br/>
boolean chamber(  )<br/>
int tavern(  )<br/>
int random( int )<br/>
int round( float )<br/>
int truncate( float )<br/>
int floor( float )<br/>
int ceil( float )<br/>
float square_root( float )<br/>
string url_encode( string )<br/>
string url_decode( string )<br/>
string get_property( string )<br/>
void set_property( string, string )<br/>
int count( aggregate )<br/>
void clear( aggregate )<br/>
boolean file_to_map( string, aggregate )<br/>
boolean file_to_map( string, aggregate, boolean )<br/>
boolean map_to_file( aggregate, string )<br/>
boolean map_to_file( aggregate, string, boolean )<br/>
location my_location(  )<br/>
monster [int] get_monsters( location )<br/>
int expected_damage(  )<br/>
int expected_damage( monster )<br/>
int monster_level_adjustment(  )<br/>
int weight_adjustment(  )<br/>
int mana_cost_modifier(  )<br/>
int raw_damage_absorption(  )<br/>
float damage_absorption_percent(  )<br/>
int damage_reduction(  )<br/>
float elemental_resistance( element )<br/>
float elemental_resistance(  )<br/>
float elemental_resistance( monster )<br/>
float combat_rate_modifier(  )<br/>
float initiative_modifier(  )<br/>
float experience_bonus(  )<br/>
float meat_drop_modifier(  )<br/>
float item_drop_modifier(  )<br/>
int buffed_hit_stat(  )<br/>
stat current_hit_stat(  )<br/>
element monster_element(  )<br/>
element monster_element( monster )<br/>
int monster_attack(  )<br/>
int monster_attack( monster )<br/>
int monster_defense(  )<br/>
int monster_defense( monster )<br/>
int monster_hp(  )<br/>
int monster_hp( monster )<br/>
int item_drops(  )<br/>
int item_drops( monster )<br/>
boolean will_usually_miss(  )<br/>
boolean will_usually_dodge(  )<br/>
float numeric_modifier( string )<br/>
float numeric_modifier( item, string )<br/>
float numeric_modifier( effect, string )<br/>
float numeric_modifier( skill, string )<br/>
boolean boolean_modifier( string )<br/>
boolean boolean_modifier( item, string )<br/>
effect effect_modifier( item, string )<br/>
class class_modifier( item, string )<br/>
stat stat_modifier( effect, 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).