Difference between pages "Compiling from Source" and "Ash Functions"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
m (→‎Linux: no need to specific a version, use java latest)
 
(fixing get_stack_trace)
 
Line 1: Line 1:
To contribute to the Mafia project, you'll need to be able to install the Java Development Kit, connect to the SVN and be comfortable writing Java Code. Instructions for the first two are included below:
+
{{TOCright}}
 +
Master list of all ASH functions. All functions as of r20129 are listed; this list is intended to be kept current, but it is possible that some functions added since the above revision may be missing. (Please feel free to add in any you notice.)
 +
The CLI command "[[ashref]]" shows every implemented ash function for your mafia version.
 +
===a===
 +
{{FunctionEmbed|abort|format=signature}}
 +
{{FunctionEmbed|add_item_condition|format=signature}}
 +
{{Flink|boolean|adv1|location|int|string}}
 +
{{Flink|int|adv_cost|skill}}
 +
{{Flink|boolean|adventure|int|location|{{opt|string}}}}
 +
{{FunctionEmbed|all_monsters_with_id|format=signature}}
 +
{{Flink|string [int]|all_normal_outfits}}
 +
{{Flink|float [monster]|appearance_rates|location|{{opt|boolean}}}}
 +
{{Flink|buffer|append|buffer|string}}
 +
{{Flink|buffer|append_replacement|matcher|buffer|string}}
 +
{{Flink|buffer|append_tail|matcher|buffer}}
 +
{{Flink|buffer|attack}}
 +
{{Flink|boolean|autosell|int|item}}
 +
{{Flink|int|autosell_price|item}}
 +
{{Flink|int|available_amount|item}}
 +
{{FunctionEmbed|available_choice_options}}
  
==Windows==
+
===b===
# Download Tools
+
{{Flink|boolean|batch_close}}
## Download and install Java Development Kit 1.8 or newer, available from [https://www.oracle.com/java/technologies/javase-downloads.html Oracle] or [https://adoptopenjdk.net AdoptOpenJDK]
+
{{Flink|void|batch_open}}
## Download and install Subversion, from [https://subversion.apache.org/packages.html apache.org]
+
{{Flink|boolean|bjornify_familiar|familiar}}
## Download and install Tortoise SVN (or of course, another SVN program)from [https://tortoisesvn.net/downloads.html tortoisesvn]
+
{{Flink|boolean|black_market_available}}
## Download and install ANT, from [https://ant.apache.org/bindownload.cgi apache.org]
+
{{Flink|boolean|boolean_modifier|{{opt|string}}|string}}
# Configure Windows Environment Variables[[File:Environment vars.jpg|thumb|Win 10 Environment Variable Editor]]
+
{{Flink|boolean|boolean_modifier|item|string}}
## Windows 10
+
{{Flink|int|buffed_hit_stat}}
### Go to settings
+
{{FunctionEmbed|buffer_to_file|format=signature}}
### type 'enviro' in the search
+
{{Flink|boolean|buy|{{opt|coinmaster}}|int|item}}
### click on the 'edit environment variables' suggestion
+
{{Flink|int|buy|int|item|int}}
### add or edit ANT_HOME, JAVA_HOME, and PATH variables<br>''PATH should include ANT_HOME/bin and JAVA_HOME''</br>If ANT or JAVA installers have already set these variables, they can be updated or left alone.
+
{{Flink|int|buy_price|coinmaster|item}}
# Get Source and Build
+
{{Flink|boolean|buy_using_storage|int|item}}
## Connect to the SVN server and download the source code for the Mafia Project. Using Tortoise SVN, you have to right-click on your desktop, select "SVN Checkout", and put the URL of the repository as "svn://svn.code.sf.net/p/kolmafia/code/". Leave all other settings as they are, and click OK.
+
{{Flink|int|buy_using_storage|int|item|int}}
## Copy %ANT_HOME%/bin/ant.bat to your Desktop/kolmafia/ folder. If you have set up ANT correctly (and it's hard not to - there aren't many options) then double clicking on this file should compile the program.
+
{{Flink|boolean|buys_item|coinmaster|item}}
# Compiling creates a "build" and "dist" folder. The end program is in dist/Kolmafia.jar.
 
===Troubleshooting===
 
====Double-Clicking ''ant.bat''====
 
Due to how bat files work when you double-click them, ''ant.bat'' will auto-close before you can read its output.
 
# ant assumes that builds are done from a command shell.  You'll need to run from the command shell to execute any ant target other than the default, such as ''ant.bat update exec'' or ''ant.bat daily</br>ant -projecthelp'' will list all main targets
 
# An easy workaround is to add a "pause" near the bottom of the file before it has a chance to auto-close on you.<br>When you run it again, you'll be able to read its output and it will exit after you ''Press any key to continue...''
 
# Alternatively, you can create a wrapper batch file that calls the existing ''ant.bat'' file and adds a pause after executing it.  This method allows you to set different ant targets and also prevents updates to ant from overwriting your modifications.
 
<blockquote>Example of a very simple MyWrapper.bat file<pre>
 
# This is a wrapper batch file
 
# First it runs ant
 
call ant.bat daily
 
# Then it pauses
 
pause</pre></blockquote>
 
  
====''tools.jar'' not found====
+
===c===
If you get an error message about "tools.jar" not being found, this means you're trying to build with the JRE (which doesn't contain this file) rather than the JDK (which contains it).<br>
+
{{Flink|boolean|can_drink}}
To fix this, right click on ''my computer'' -> ''properties'' -> ''advanced system settings'' -> ''Environment Variables...'' then make sure your PATH contains a reference to the location of your JDK directory.
+
{{Flink|boolean|can_eat}}
 +
{{Flink|boolean|can_equip|item}}
 +
{{Flink|boolean|can_faxbot|monster}}
 +
{{Flink|boolean|can_interact}}
 +
{{Flink|boolean|can_still_steal}}
 +
{{Flink|boolean|canadia_available}}
 +
{{Flink|item [0]|candy_for_tier|int|{{opt|int}}}}
 +
{{Flink|int|ceil|float}}
 +
{{Flink|boolean|change_mcd|int}}
 +
{{Flink|string|char_at|string|int}}
 +
{{Flink|void|chat_clan|string|{{opt|string}}}}
 +
{{Flink|void|chat_macro|string}}
 +
{{Flink|void|chat_notify|string|string}}
 +
{{Flink|void|chat_private|string|string}}
 +
{{Flink|boolean|chew|int|item}}
 +
{{Flink|boolean|choice_follows_fight}}
 +
{{Flink|class|class_modifier|string|string}}
 +
{{Flink|class|class_modifier|item|string}}
 +
{{Flink|void|clear|aggregate}}
 +
{{FunctionEmbed|cli_execute|format=signature}}
 +
{{FunctionEmbed|cli_execute_output|format=signature}}
 +
{{Flink|int|closet_amount|item}}
 +
{{Flink|int|combat_mana_cost_modifier}}
 +
{{Flink|float|combat_rate_modifier}}
 +
{{FunctionEmbed|contains_text|format=signature}}
 +
{{Flink|void|council}}
 +
{{Flink|int|count|aggregate}}
 +
{{Flink|boolean|craft|string|int|item|item}}
 +
{{Flink|string|craft_type|item}}
 +
{{Flink|int|creatable_amount|item}}
 +
{{Flink|int|creatable_turns|{{opt|item}}|{{opt|int}}|{{opt|boolean}}}}
 +
{{Flink|boolean|create|int|item}}
 +
{{Flink|matcher|create_matcher|string|string}}
 +
{{Flink|stat|current_hit_stat}}
 +
{{Flink|int|current_mcd}}
 +
{{Flink|int [string]|current_pvp_stances}}
 +
{{Flink|int|current_rad_sickness}}
 +
{{Flink|int|current_round}}
  
==Linux==
+
===d===
 +
{{Flink|element|dad_sea_monkee_weakness|int}}
 +
{{Flink|item|daily_special}}
 +
{{Flink|float|damage_absorption_percent}}
 +
{{Flink|int|damage_reduction}}
 +
{{Flink|buffer|delete|buffer|int|int}}
 +
{{Flink|effect|desc_to_effect|string}}
 +
{{Flink|item|desc_to_item|string}}
 +
{{Flink|void|disable|string}}
 +
{{Flink|boolean|dispensary_available}}
 +
{{Flink|int|display_amount|item}}
 +
{{Flink|boolean|drink|int|item}}
 +
{{Flink|boolean|drinksilent|item|{{opt|int}}}}
  
# Install Sun Java Development Kit ( debian: apt-get install sun-java6-jdk )
+
===e===
# Install Subversion ( debian: apt-get install svn )
+
{{Flink|boolean|eat|int|item}}
# Install Ant ( debian: apt-get install ant )
+
{{Flink|boolean|eatsilent|int|item}}
# Connect to the SVN server and download the source code for the Mafia Project. ( svn checkout svn://svn.code.sf.net/p/kolmafia/code/ kolmafia )
+
{{Flink|effect|effect_modifier|string|string}}
# Verify tou are using sun-java with ( debian: update-alternatives --all )
+
{{Flink|effect|effect_modifier|item|string}}
# I had to change $JAVA_HOME to compile ( export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.12 )
+
{{Flink|float|elemental_resistance|element}}
# Compile kolmafia with Ant ( debian: cd kolmafia && ant debian )
+
{{Flink|float|elemental_resistance|{{opt|monster}}}}
# Install kolmafia ( debian: cd dist && dpkg -i kolmafia*.deb )
+
{{Flink|boolean|empty_closet}}
 +
{{Flink|void|enable|string}}
 +
{{Flink|int|end|matcher|{{opt|int}}}}
 +
{{FunctionEmbed|ends_with|format=signature}}
 +
{{Flink|boolean|enthrone_familiar|familiar}}
 +
{{Flink|string|entity_decode|string}}
 +
{{Flink|string|entity_encode|string}}
 +
{{Flink|boolean|equip|{{opt|slot}}|item}}
 +
{{Flink|boolean|equip_all_familiars}}
 +
{{Flink|int|equipped_amount|item}}
 +
{{Flink|item|equipped_item|slot}}
 +
{{Flink|string|eudora}}
 +
{{Flink|boolean|eudora|string}}
 +
{{Flink|string|every_card_name|strict_string}}
 +
{{Flink|int|expected_damage|{{opt|monster}}}}
 +
{{Flink|float|experience_bonus}}
 +
{{Flink|float|expression_eval}}
 +
{{Flink|int [item]|extract_items|string}}
 +
{{Flink|int|extract_meat|string}}
  
===Fedora (or probably other RPM systems)===
+
===f===
 +
{{Flink|item|familiar_equipment|familiar}}
 +
{{Flink|item|familiar_equipped_equipment|familiar}}
 +
{{Flink|int|familiar_weight|familiar}}
 +
{{Flink|boolean [familiar]|favorite_familiars|}}
 +
{{Flink|boolean|faxbot|monster}}
 +
{{Flink|boolean|fight_follows_choice}}
 +
{{FunctionEmbed|file_to_array|format=signature}}
 +
{{FunctionEmbed|file_to_buffer|format=signature}}
 +
{{Flink|boolean|file_to_map|string|aggregate|{{opt|boolean}}}}
 +
{{Flink|boolean|find|matcher}}
 +
{{Flink|int|floor|float}}
 +
{{Flink|boolean|florist_available}}
 +
{{Flink|boolean|flush_monster_manuel_cache}}
 +
{{Flink|string|form_field|string}}
 +
{{Flink|string [string]|form_fields}}
 +
{{Flink|string|format_date_time|string|string|string}}
 +
{{Flink|boolean|friars_available}}
 +
{{Flink|int|fuel_cost|skill}}
 +
{{Flink|int|fullness_limit}}
  
# Install Subversion: <pre>sudo yum install sqlite-devel subversion </pre>
+
===g===
# Install Java JDK: <pre>sudo yum install java-latest-openjdk-devel</pre>
+
{{Flink|boolean|galaktik_cures_discounted}}
# Install Ant: <pre>sudo yum install ant</pre>
+
{{Flink|int|gameday_to_int}}
# Checkout: <pre>svn checkout svn://svn.code.sf.net/p/kolmafia/code/ kolmafia</pre>
+
{{Flink|string|gameday_to_string}}
# Build: <pre>cd kolmafia && ant</pre></pre>
+
{{Flink|int|gametime_to_int}}
 +
{{Flink|boolean [string] |get_all_properties|string|boolean}}
 +
{{Flink|int|get_auto_attack}}
 +
{{Flink|int [item]|get_campground}}
 +
{{Flink|string |get_ccs_action|int}}
 +
{{Flink|int [item]|get_chateau}}
 +
{{Flink|int|get_clan_id}}
 +
{{Flink|int [item]|get_clan_lounge}}
 +
{{Flink|string|get_clan_name}}
 +
{{Flink|int [string]|get_clan_rumpus}}
 +
{{Flink|int [item]|get_closet}}
 +
{{Flink|string|get_counters|string|int|int}}
 +
{{Flink|string [int]|get_custom_outfits}}
 +
{{Flink|item|get_dwelling}}
 +
{{Flink|string [location, 3]|get_florist_plants}}
 +
{{Flink|int [item]|get_free_pulls}}
 +
{{Flink|int|get_fuel}}
 +
{{Flink|string [int]|get_goals}}
 +
{{Flink|boolean|get_ignore_zone_warnings}}
 +
{{Flink|int [item]|get_ingredients|item}}
 +
{{Flink|int [item]|get_inventory}}
 +
{{Flink|boolean [monster]|get_location_monsters|location}}
 +
{{Flink|monster [monster]|get_monster_mapping|{{opt|string}}}}
 +
{{Flink|monster [int]|get_monsters|location}}
 +
{{Flink|string [int]|get_moods}}
 +
{{Flink|string [int]|get_outfits}}
 +
{{Flink|string|get_path}}
 +
{{Flink|string|get_path_full}}
 +
{{Flink|string|get_path_variables}}
 +
{{Flink|string|get_player_id|string}}
 +
{{Flink|string|get_player_name|int}}
 +
{{Flink|int|get_power|item}}
 +
{{Flink|string|get_property|string|{{opt|boolean}}}}
 +
{{Flink|int [item]|get_related|item|string}}
 +
{{Flink|int|get_revision}}
 +
{{Flink|int [item]|get_shop}}
 +
{{Flink|string [0]|get_shop_log}}
 +
{{Flink|string string int [0]|get_stack_trace}}
 +
{{Flink|int [item]|get_stash}}
 +
{{Flink|int [item]|get_storage}}
 +
{{Flink|string|get_version}}
 +
{{Flink|boolean|gnomads_available}}
 +
{{Flink|boolean|goal_exists|string}}
 +
{{Flink|string|group|matcher|{{opt|int}}}}
 +
{{Flink|int|group_count|matcher}}
 +
{{Flink|boolean [string]|group_names|matcher}}
 +
{{Flink|string [int, int]|group_string|string|string}}
 +
{{Flink|boolean|guild_store_available}}
  
You have a KoLmafia jar file that can be invoked with <pre>java -jar dist/KoLmafia-*.jar</pre>
+
===h===
 +
{{Flink|boolean|handling_choice}}
 +
{{Flink|boolean|have_bartender}}
 +
{{Flink|boolean|have_chef}}
 +
{{Flink|boolean|have_display}}
 +
{{Flink|int|have_effect|effect}}
 +
{{Flink|boolean|have_equipped|item}}
 +
{{Flink|boolean|have_familiar|familiar}}
 +
{{Flink|boolean|have_mushroom_plot}}
 +
{{Flink|boolean|have_outfit|string}}
 +
{{Flink|boolean|have_servant|servant}}
 +
{{Flink|boolean|have_shop}}
 +
{{Flink|boolean|have_skill|skill}}
 +
{{Flink|boolean|hedge_maze|string}}
 +
{{Flink|boolean|hermit|int|item}}
 +
{{Flink|boolean|hidden_temple_unlocked}}
 +
{{Flink|boolean|hippy_stone_broken}}
 +
{{Flink|boolean|hippy_store_available}}
 +
{{FunctionEmbed|historical_age}}
 +
{{FunctionEmbed|historical_price}}
 +
{{Flink|string|holiday}}
 +
{{Flink|int|hp_cost|skill}}
  
Do other installation steps as you wish.
+
===i===
 +
{{Flink|monster|image_to_monster|strict_string}}
 +
{{Flink|boolean|in_bad_moon}}
 +
{{Flink|boolean|in_hardcore}}
 +
{{Flink|boolean|in_moxie_sign}}
 +
{{Flink|boolean|in_multi_fight}}
 +
{{Flink|boolean|in_muscle_sign}}
 +
{{Flink|boolean|in_mysticality_sign}}
 +
{{Flink|string|inaccessible_reason|coinmaster}}
 +
{{FunctionEmbed|index_of|format=signature}}
 +
{{Flink|int|inebriety_limit}}
 +
{{Flink|float|initiative_modifier}}
 +
{{Flink|buffer|insert|buffer|int|string}}
 +
{{Flink|boolean|is_accessible|coinmaster}}
 +
{{Flink|boolean|is_banished|monster}}
 +
{{Flink|boolean|is_coinmaster_item|item}}
 +
{{FunctionEmbed|is_dark_mode}}
 +
{{Flink|boolean|is_discardable|item}}
 +
{{Flink|boolean|is_displayable|item}}
 +
{{Flink|boolean|is_familiar_equipment_locked}}
 +
{{Flink|boolean|is_giftable|item}}
 +
{{Flink|boolean|is_goal|item}}
 +
{{Flink|boolean|is_integer|string}}
 +
{{Flink|boolean|is_npc_item|item}}
 +
{{Flink|boolean|is_online|string}}
 +
{{Flink|boolean|is_tradeable|item}}
 +
{{Flink|boolean|is_trendy|item/familiar/skill/string}}
 +
{{Flink|boolean|is_unrestricted|item/familiar/skill/string}}
 +
{{Flink|boolean|is_wearing_outfit|string}}
 +
{{Flink|int|item_amount|item}}
 +
{{Flink|float|item_drop_modifier}}
 +
{{Flink|int [item]|item_drops|{{opt|monster}}}}
 +
{{Flink|record [int]|item_drops_array|{{opt|monster}}}}
 +
{{Flink|string|item_type|item}}
  
==MacOSX==
+
===j===
# Install required packages</br>''MacOS X packages for Java, subversion, and ANT may also be installed via a package manager like [https://brew.sh Homebrew] or [https://www.macports.org MacPorts].  The instructions are written for a direct installation of the packages.''
+
{{flink|int|jump_chance|{{opt|monster}}|{{opt|int}}|{{opt|int}}}}
## Install Java Development Kit version 1.8 or newer from [https://www.oracle.com/java/technologies/javase-downloads.html Oracle] or [https://adoptopenjdk.net OpenJDK]
+
{{flink|int|jump_chance|location|{{opt|int}}|{{opt|int}}}}
## Install Subversion 1.10 or newer from [https://subversion.apache.org/packages.html apache.org]
 
## Install Ant 1.9 or newer from [https://ant.apache.org/bindownload.cgi apache.org]
 
# Configure development environment</br>Most of these steps can be included in ''.profile'' or the equivalent for your terminal of choice.
 
## In the terminal set JAVA_HOME to the java home directory. </br>''/usr/libexec/java_home -V'' will list all known values for java_home.</br>If you have multiple copies of java, choose the version you want to us''e.
 
## In the terminal set ANT_HOME to the location of ANT.  e.g. ''/opt/ant''
 
## In the terminal make sure that Ant and subversion are in your ${PATH} variable. e.g.''PATH=${PATH}:/usr/local/opt/subversion/bin:/usr/local/ant/bin''
 
# Open a new terminal window and navigate to the directory to which you wish to create kolmafia (e.g. cd ~/Projects, or some similar directory)
 
# Connect to the SVN server and download the source code for the KoLmafia Project.</br>''svn checkout <nowiki>svn://svn.code.sf.net/p/kolmafia/code/</nowiki> kolmafia''
 
# Compile KoLmafia with Ant (''cd kolmafia && ant daily'')
 
# execute KoLmafia with the command ''java -jar dist/KoLmafia-*.jar
 
  
[[Category:Tech Support]]
+
===k===
 +
{{flink|boolean|knoll_available}}
 +
 
 +
===l===
 +
{{Flink|int|last_choice}}
 +
{{Flink|int|last_decision}}
 +
{{FunctionEmbed|last_index_of|format=signature}}
 +
{{Flink|string|last_item_message}}
 +
{{Flink|monster|last_monster}}
 +
{{Flink|string|last_skill_message}}
 +
{{Flink|string|leetify|string}}
 +
{{Flink|int|length|string}}
 +
{{Flink|int|lightning_cost}}
 +
{{Flink|string|limit_mode}}
 +
{{Flink|buffer|load_html|string}}
 +
{{Flink|void|lock_familiar_equipment|boolean}}
 +
{{Flink|void|logprint|string}}
 +
 
 +
===m===
 +
{{Flink|string|make_url|string|boolean|boolean}}
 +
{{FunctionEmbed|mall_price}}
 +
{{FunctionEmbed|mall_prices}}
 +
{{Flink|int|mana_cost_modifier}}
 +
{{Flink|boolean|map_to_file|aggregate|string|{{opt|boolean}}}}
 +
{{Flink|float|max|float|float}}
 +
{{Flink|int|max|int|int}}
 +
{{Flink|boolean|maximize|string|boolean}}
 +
{{Flink|boolean|maximize|string|int|int|boolean}}
 +
{{Flink|record [int]|maximize|string|int|int|boolean|boolean}}
 +
{{Flink|int|meat_drop|{{opt|monster}}}}
 +
{{Flink|float|meat_drop_modifier}}
 +
{{Flink|float|min|float|float}}
 +
{{Flink|int|min|int|int}}
 +
{{Flink|item|minstrel_instrument}}
 +
{{Flink|int|minstrel_level}}
 +
{{Flink|boolean|minstrel_quest}}
 +
{{Flink|float|modifier_eval|string}}
 +
{{Flink|int|monster_attack|{{opt|monster}}}}
 +
{{Flink|int|monster_defense|{{opt|monster}}}}
 +
{{Flink|element|monster_element|{{opt|monster}}}}
 +
{{Flink|float|monster_eval|string}}
 +
{{Flink|int|monster_factoids_available|monster|boolean}}
 +
{{Flink|int|monster_hp|{{opt|monster}}}}
 +
{{Flink|int|monster_initiative|{{opt|monster}}}}
 +
{{Flink|int|monster_level_adjustment}}
 +
{{Flink|string|monster_manuel_text|monster}}
 +
{{Flink|phylum|monster_phylum|{{opt|monster}}}}
 +
{{Flink|void|mood_execute}}
 +
{{Flink|string [0]|mood_list}}
 +
{{Flink|int|moon_light}}
 +
{{Flink|int|moon_phase}}
 +
{{Flink|int|mp_cost|skill}}
 +
{{Flink|int|my_absorbs}}
 +
{{Flink|int|my_adventures}}
 +
{{Flink|int|my_ascensions}}
 +
{{Flink|int|my_audience}}
 +
{{Flink|int|my_basestat|stat}}
 +
{{Flink|familiar|my_bjorned_familiar}}
 +
{{Flink|int|my_buffedstat|stat}}
 +
{{Flink|class|my_class}}
 +
{{Flink|int|my_closet_meat}}
 +
{{Flink|string|my_companion}}
 +
{{Flink|int|my_daycount}}
 +
{{Flink|int|my_discomomentum}}
 +
{{Flink|familiar|my_effective_familiar}}
 +
{{Flink|int [effect]|my_effects}}
 +
{{Flink|familiar|my_enthroned_familiar}}
 +
{{Flink|familiar|my_familiar}}
 +
{{Flink|int|my_fullness}}
 +
{{Flink|int|my_fury}}
 +
{{Flink|string|my_garden_type}}
 +
{{Flink|string|my_hash}}
 +
{{Flink|int|my_hp}}
 +
{{Flink|string|my_id}}
 +
{{Flink|int|my_inebriety}}
 +
{{Flink|int|my_level}}
 +
{{Flink|int|my_lightning}}
 +
{{Flink|location|my_location}}
 +
{{Flink|string|my_mask}}
 +
{{Flink|int|my_maxfury}}
 +
{{Flink|int|my_maxhp}}
 +
{{Flink|int|my_maxmp}}
 +
{{Flink|int|my_maxpp}}
 +
{{Flink|int|my_meat}}
 +
{{Flink|int|my_mp}}
 +
{{Flink|string|my_name}}
 +
{{Flink|string|my_path}}
 +
{{Flink|familiar|my_poke_fam}}
 +
{{Flink|int|my_pp}}
 +
{{Flink|stat|my_primestat}}
 +
{{Flink|int|my_rain}}
 +
{{Flink|servant|my_servant|servant}}
 +
{{Flink|int|my_session_adv}}
 +
{{Flink|int [item]|my_session_items}}
 +
{{Flink|int|my_session_meat}}
 +
{{Flink|string|my_sign}}
 +
{{Flink|int|my_soulsauce}}
 +
{{Flink|int|my_spleen_use}}
 +
{{Flink|int|my_storage_meat}}
 +
{{Flink|thrall|my_thrall}}
 +
{{Flink|int|my_thunder}}
 +
{{Flink|int|my_turncount}}
 +
{{Flink|vykea|my_vykea_companion}}
 +
 
 +
===n===
 +
{{Flink|float|now_to_string|string}}
 +
{{Flink|int|npc_price|item}}
 +
{{Flink|string|numberology_prize|int}}
 +
{{Flink|float|numeric_modifier|{{opt|string}}|string}}
 +
{{Flink|float|numeric_modifier|item|string}}
 +
{{Flink|float|numeric_modifier|effect|string}}
 +
{{Flink|float|numeric_modifier|skill|string}}
 +
{{Flink|float|numeric_modifier|familiar|string|int|item}}
 +
 
 +
===o===
 +
{{Flink|boolean|outfit|string}}
 +
{{Flink|item [int]|outfit_pieces|string}}
 +
{{Flink|string|outfit_tattoo|{{opt|string}}}}
 +
{{FunctionEmbed|overdrink|format=signature}}
 +
 
 +
===p===
 +
{{Flink|void|print|string|{{opt|string}}}}
 +
{{Flink|void|print_html|string}}
 +
{{FunctionEmbed|property_default_value|format=signature}}
 +
{{FunctionEmbed|property_exists|format=signature}}
 +
{{FunctionEmbed|property_has_default|format=signature}}
 +
{{Flink|int|pulls_remaining}}
 +
{{Flink|boolean|put_closet|int|{{opt|item}}}}
 +
{{Flink|boolean|put_display|int|item}}
 +
{{Flink|boolean|put_shop|int|int|{{opt|int}}|item}}
 +
{{Flink|boolean|put_shop_using_storage|int|int|{{opt|int}}|item}}
 +
{{Flink|boolean|put_stash|int|item}}
 +
{{Flink|int|pvp_attacks_left}}
 +
 
 +
===r===
 +
{{Flink|int|rain_cost|skill}}
 +
{{Flink|int|random|int}}
 +
{{Flink|int|raw_damage_absorption}}
 +
{{Flink|void|refresh_shop}}
 +
{{Flink|void|refresh_stash}}
 +
{{Flink|void|refresh_status}}
 +
{{Flink|void|remove_item_condition|int|item}}
 +
{{FunctionEmbed|remove_property|format=signature}}
 +
{{FunctionEmbed|rename_property|format=signature}}
 +
{{Flink|boolean|replace|buffer|int|int|string}}
 +
{{Flink|string|replace_all|matcher|string}}
 +
{{Flink|string|replace_first|matcher|string}}
 +
{{Flink|buffer|replace_string|buffer|string|string}}
 +
{{Flink|buffer|replace_string|string|string|string}}
 +
{{Flink|boolean|reprice_shop|int|{{opt|int}}|item}}
 +
{{Flink|matcher|reset|matcher|{{opt|string}}}}
 +
{{Flink|boolean|restore_hp|int}}
 +
{{Flink|boolean|restore_mp|int}}
 +
{{Flink|boolean|retrieve_item|int|item}}
 +
{{Flink|int [int]|reverse_numberology|{{opt|int|int}}}}
 +
{{Flink|int|rollover}}
 +
{{Flink|int|round|float}}
 +
{{FunctionEmbed|run_choice|format=signature}}
 +
{{Flink|buffer|run_combat|{{opt|string}}}}
 +
{{Flink|buffer|run_turn}}
 +
{{Flink|buffer|runaway}}
 +
 
 +
===s===
 +
{{Flink|boolean|sell|coinmaster|int|item}}
 +
{{Flink|int|sell_price|coinmaster|item}}
 +
{{Flink|boolean|sells_item|coinmaster|item}}
 +
{{Flink|string [int]|session_logs|{{opt|string}}|int}}
 +
{{Flink|void|set_auto_attack|int}}
 +
{{Flink|void|set_length|buffer|int}}
 +
{{Flink|void|set_location|location}}
 +
{{Flink|void|set_property|string|string}}
 +
{{Flink|int|shop_amount|item}}
 +
{{Flink|int|shop_price|item}}
 +
{{Flink|skill|skill_modifier|string|string}}
 +
{{Flink|int|slash_count|item}}
 +
{{Flink|int|soulsauce_cost|skill}}
 +
{{Flink|int|spleen_limit}}
 +
{{Flink|string [int]|split_string|string|{{opt|string}}}}
 +
{{Flink|float|square_root|float}}
 +
{{Flink|int|start|matcher|{{opt|int}}}}
 +
{{FunctionEmbed|starts_with|format=signature}}
 +
{{Flink|int|stash_amount|item}}
 +
{{Flink|stat|stat_bonus_today}}
 +
{{Flink|stat|stat_bonus_tomorrow}}
 +
{{Flink|stat|stat_modifier|effect|string}}
 +
{{Flink|buffer|steal}}
 +
{{Flink|int|stills_available}}
 +
{{Flink|void|stop_counter|string}}
 +
{{Flink|int|storage_amount|item}}
 +
{{Flink|string|string_modifier|{{opt|string}}|string}}
 +
{{Flink|skill|stun_skill}}
 +
{{Flink|string|substring|string|int|{{opt|int}}}}
 +
{{Flink|boolean|svn_at_head|string}}
 +
{{Flink|boolean|svn_exists|string}}
 +
{{Flink|record|svn_info|string}}
 +
{{Flink|boolean|sweet_synthesis|effect}}
 +
{{Flink|item [0]|sweet_synthesis_pair|effect}}
 +
{{Flink|effect|sweet_synthesis_result|item|item}}
 +
 
 +
===t===
 +
{{Flink|boolean|take_closet|int|{{opt|item}}}}
 +
{{Flink|boolean|take_display|int|item}}
 +
{{Flink|boolean|take_shop|{{opt|int}}|item}}
 +
{{Flink|boolean|take_stash|int|item}}
 +
{{Flink|boolean|take_storage|int|item}}
 +
{{Flink|int|tavern|{{opt|string}}}}
 +
{{Flink|buffer|throw_item|item}}
 +
{{Flink|buffer|throw_items|item|item}}
 +
{{Flink|int|thunder_cost|skill}}
 +
{{Flink|buffer|time_to_string}}
 +
{{Flink|boolean|to_boolean|any}}
 +
{{Flink|bounty|to_bounty|strict_string}}
 +
{{Flink|class|to_class|strict_string/int}}
 +
{{Flink|coinmaster|to_coinmaster|strict_string}}
 +
{{Flink|effect|to_effect|int}}
 +
{{Flink|effect|to_effect|strict_string}}
 +
{{Flink|effect|to_effect|skill}}
 +
{{Flink|element|to_element|strict_string}}
 +
{{Flink|familiar|to_familiar|int}}
 +
{{Flink|familiar|to_familiar|strict_string}}
 +
{{Flink|float|to_float|any}}
 +
{{Flink|int|to_int|any}}
 +
{{Flink|item|to_item|strict_string}}
 +
{{Flink|item|to_item|int}}
 +
{{Flink|item|to_item|string|int}}
 +
{{Flink|string|to_json|aggregate}}
 +
{{Flink|location|to_location|strict_string}}
 +
{{Flink|location|to_location|int}}
 +
{{Flink|string|to_lower_case|string}}
 +
{{Flink|monster|to_monster|strict_string}}
 +
{{Flink|phylum|to_phylum|string}}
 +
{{Flink|string|to_plural|item}}
 +
{{Flink|servant|to_servant|int}}
 +
{{Flink|servant|to_servant|strict_string}}
 +
{{Flink|skill|to_skill|effect}}
 +
{{Flink|skill|to_skill|int}}
 +
{{Flink|skill|to_skill|strict_string}}
 +
{{Flink|slot|to_slot|item}}
 +
{{Flink|skill|to_slot|strict_string}}
 +
{{Flink|stat|to_stat|string}}
 +
{{Flink|string|to_string|any}}
 +
{{Flink|thrall|to_thrall|{{opt|string}}|{{opt|int}}}}
 +
{{Flink|string|to_upper_case|string}}
 +
{{Flink|string|to_url|location}}
 +
{{Flink|vykea|to_vykea|strict_string}}
 +
{{Flink|string|today_to_string}}
 +
{{Flink|int|total_free_rests}}
 +
{{Flink|int|total_turns_played}}
 +
{{Flink|boolean|tower_door}}
 +
{{Flink|void|traceprint|string}}
 +
{{Flink|int|truncate|float}}
 +
{{Flink|int|turns_per_cast|skill}}
 +
{{Flink|int|turns_played}}
 +
 
 +
===u===
 +
{{Flink|string|url_decode|string}}
 +
{{Flink|string|url_encode|string}}
 +
{{Flink|boolean|use|int|item}}
 +
{{Flink|boolean|use_familiar|familiar}}
 +
{{Flink|boolean|use_servant|servant}}
 +
{{Flink|boolean|use_skill|int|skill|{{opt|string}}}}
 +
{{Flink|buffer|use_skill|skill}}
 +
{{Flink|boolean|user_confirm|string}}
 +
{{Flink|boolean|user_confirm|string|int|boolean}}
 +
 
 +
===v===
 +
{{Flink|boolean|visit|coinmaster}}
 +
{{FunctionEmbed|visit_url}}
 +
 
 +
===w===
 +
{{Flink|void|wait|int}}
 +
{{Flink|void|waitq|int}}
 +
{{Flink|int|weapon_hands|item}}
 +
{{Flink|stat|weapon_type|item}}
 +
{{Flink|int|weight_adjustment}}
 +
{{Flink|boolean|white_citadel_available}}
 +
{{Flink|boolean [string]|who_clan|{{opt|string}}}}
 +
{{Flink|boolean|will_usually_dodge}}
 +
{{Flink|boolean|will_usually_miss}}
 +
{{Flink|void|write|string}}
 +
{{Flink|void|writeln|string}}
 +
 
 +
===x===
 +
{{Flink|string[int]|xpath|string|string}}
 +
 
 +
[[Category:Scripting]]

Revision as of 17:44, 24 April 2021

Master list of all ASH functions. All functions as of r20129 are listed; this list is intended to be kept current, but it is possible that some functions added since the above revision may be missing. (Please feel free to add in any you notice.) The CLI command "ashref" shows every implemented ash function for your mafia version.

a

void abortstring? )

void add_item_conditionint, item )

void add_item_conditionitem, int )

boolean adv1( location, int, string )

int adv_cost( skill )

boolean adventure( int, location, [string] )

boolean [monster] all_monsters_with_id()

string [int] all_normal_outfits()

float [monster] appearance_rates( location, [boolean] )

buffer append( buffer, string )

buffer append_replacement( matcher, buffer, string )

buffer append_tail( matcher, buffer )

buffer attack()

boolean autosell( int, item )

int autosell_price( item )

int available_amount( item )

string [int] available_choice_optionsboolean? )

b

boolean batch_close()

void batch_open()

boolean bjornify_familiar( familiar )

boolean black_market_available()

boolean boolean_modifier( [string], string )

boolean boolean_modifier( item, string )

int buffed_hit_stat()

boolean buffer_to_filebuffer, string )

boolean buy( [coinmaster], int, item )

int buy( int, item, int )

int buy_price( coinmaster, item )

boolean buy_using_storage( int, item )

int buy_using_storage( int, item, int )

boolean buys_item( coinmaster, item )


c

boolean can_drink()

boolean can_eat()

boolean can_equip( item )

boolean can_faxbot( monster )

boolean can_interact()

boolean can_still_steal()

boolean canadia_available()

item [0] candy_for_tier( int, [int] )

int ceil( float )

boolean change_mcd( int )

string char_at( string, int )

void chat_clan( string, [string] )

void chat_macro( string )

void chat_notify( string, string )

void chat_private( string, string )

boolean chew( int, item )

boolean choice_follows_fight()

class class_modifier( string, string )

class class_modifier( item, string )

void clear( aggregate )

boolean cli_executestring )

string cli_execute_outputstring )

int closet_amount( item )

int combat_mana_cost_modifier()

float combat_rate_modifier()

boolean contains_textstring, string )

void council()

int count( aggregate )

boolean craft( string, int, item, item )

string craft_type( item )

int creatable_amount( item )

int creatable_turns( [item], [int], [boolean] )

boolean create( int, item )

matcher create_matcher( string, string )

stat current_hit_stat()

int current_mcd()

int [string] current_pvp_stances()

int current_rad_sickness()

int current_round()


d

element dad_sea_monkee_weakness( int )

item daily_special()

float damage_absorption_percent()

int damage_reduction()

buffer delete( buffer, int, int )

effect desc_to_effect( string )

item desc_to_item( string )

void disable( string )

boolean dispensary_available()

int display_amount( item )

boolean drink( int, item )

boolean drinksilent( item, [int] )


e

boolean eat( int, item )

boolean eatsilent( int, item )

effect effect_modifier( string, string )

effect effect_modifier( item, string )

float elemental_resistance( element )

float elemental_resistance( [monster] )

boolean empty_closet()

void enable( string )

int end( matcher, [int] )

boolean ends_withstring, string )

boolean enthrone_familiar( familiar )

string entity_decode( string )

string entity_encode( string )

boolean equip( [slot], item )

boolean equip_all_familiars()

int equipped_amount( item )

item equipped_item( slot )

string eudora()

boolean eudora( string )

string every_card_name( strict_string )

int expected_damage( [monster] )

float experience_bonus()

float expression_eval()

int [item] extract_items( string )

int extract_meat( string )


f

item familiar_equipment( familiar )

item familiar_equipped_equipment( familiar )

int familiar_weight( familiar )

boolean [familiar] favorite_familiars()

boolean faxbot( monster )

boolean fight_follows_choice()

string [int] file_to_arraystring )

buffer file_to_bufferstring )

boolean file_to_map( string, aggregate, [boolean] )

boolean find( matcher )

int floor( float )

boolean florist_available()

boolean flush_monster_manuel_cache()

string form_field( string )

string [string] form_fields()

string format_date_time( string, string, string )

boolean friars_available()

int fuel_cost( skill )

int fullness_limit()


g

boolean galaktik_cures_discounted()

int gameday_to_int()

string gameday_to_string()

int gametime_to_int()

boolean [string]  get_all_properties( string, boolean )

int get_auto_attack()

int [item] get_campground()

string  get_ccs_action( int )

int [item] get_chateau()

int get_clan_id()

int [item] get_clan_lounge()

string get_clan_name()

int [string] get_clan_rumpus()

int [item] get_closet()

string get_counters( string, int, int )

string [int] get_custom_outfits()

item get_dwelling()

string [location, 3] get_florist_plants()

int [item] get_free_pulls()

int get_fuel()

string [int] get_goals()

boolean get_ignore_zone_warnings()

int [item] get_ingredients( item )

int [item] get_inventory()

boolean [monster] get_location_monsters( location )

monster [monster] get_monster_mapping( [string] )

monster [int] get_monsters( location )

string [int] get_moods()

string [int] get_outfits()

string get_path()

string get_path_full()

string get_path_variables()

string get_player_id( string )

string get_player_name( int )

int get_power( item )

string get_property( string, [boolean] )

int [item] get_related( item, string )

int get_revision()

int [item] get_shop()

string [0] get_shop_log()

string string int [0] get_stack_trace()

int [item] get_stash()

int [item] get_storage()

string get_version()

boolean gnomads_available()

boolean goal_exists( string )

string group( matcher, [int] )

int group_count( matcher )

boolean [string] group_names( matcher )

string [int, int] group_string( string, string )

boolean guild_store_available()


h

boolean handling_choice()

boolean have_bartender()

boolean have_chef()

boolean have_display()

int have_effect( effect )

boolean have_equipped( item )

boolean have_familiar( familiar )

boolean have_mushroom_plot()

boolean have_outfit( string )

boolean have_servant( servant )

boolean have_shop()

boolean have_skill( skill )

boolean hedge_maze( string )

boolean hermit( int, item )

boolean hidden_temple_unlocked()

boolean hippy_stone_broken()

boolean hippy_store_available()

float historical_ageitem )

int historical_priceitem )

string holiday()

int hp_cost( skill )


i

monster image_to_monster( strict_string )

boolean in_bad_moon()

boolean in_hardcore()

boolean in_moxie_sign()

boolean in_multi_fight()

boolean in_muscle_sign()

boolean in_mysticality_sign()

string inaccessible_reason( coinmaster )

int index_ofstring, string, int? )

int inebriety_limit()

float initiative_modifier()

buffer insert( buffer, int, string )

boolean is_accessible( coinmaster )

boolean is_banished( monster )

boolean is_coinmaster_item( item )

boolean is_dark_mode()

boolean is_discardable( item )

boolean is_displayable( item )

boolean is_familiar_equipment_locked()

boolean is_giftable( item )

boolean is_goal( item )

boolean is_integer( string )

boolean is_npc_item( item )

boolean is_online( string )

boolean is_tradeable( item )

boolean is_trendy( item/familiar/skill/string )

boolean is_unrestricted( item/familiar/skill/string )

boolean is_wearing_outfit( string )

int item_amount( item )

float item_drop_modifier()

int [item] item_drops( [monster] )

record [int] item_drops_array( [monster] )

string item_type( item )


j

int jump_chance( [monster], [int], [int] )

int jump_chance( location, [int], [int] )


k

boolean knoll_available()


l

int last_choice()

int last_decision()

int last_index_ofstring, string, int? )

string last_item_message()

monster last_monster()

string last_skill_message()

string leetify( string )

int length( string )

int lightning_cost()

string limit_mode()

buffer load_html( string )

void lock_familiar_equipment( boolean )

void logprint( string )


m

string make_url( string, boolean, boolean )

int mall_priceitem )

int mall_pricesstring, string? )

int mall_pricesboolean [item] )

int mana_cost_modifier()

boolean map_to_file( aggregate, string, [boolean] )

float max( float, float )

int max( int, int )

boolean maximize( string, boolean )

boolean maximize( string, int, int, boolean )

record [int] maximize( string, int, int, boolean, boolean )

int meat_drop( [monster] )

float meat_drop_modifier()

float min( float, float )

int min( int, int )

item minstrel_instrument()

int minstrel_level()

boolean minstrel_quest()

float modifier_eval( string )

int monster_attack( [monster] )

int monster_defense( [monster] )

element monster_element( [monster] )

float monster_eval( string )

int monster_factoids_available( monster, boolean )

int monster_hp( [monster] )

int monster_initiative( [monster] )

int monster_level_adjustment()

string monster_manuel_text( monster )

phylum monster_phylum( [monster] )

void mood_execute()

string [0] mood_list()

int moon_light()

int moon_phase()

int mp_cost( skill )

int my_absorbs()

int my_adventures()

int my_ascensions()

int my_audience()

int my_basestat( stat )

familiar my_bjorned_familiar()

int my_buffedstat( stat )

class my_class()

int my_closet_meat()

string my_companion()

int my_daycount()

int my_discomomentum()

familiar my_effective_familiar()

int [effect] my_effects()

familiar my_enthroned_familiar()

familiar my_familiar()

int my_fullness()

int my_fury()

string my_garden_type()

string my_hash()

int my_hp()

string my_id()

int my_inebriety()

int my_level()

int my_lightning()

location my_location()

string my_mask()

int my_maxfury()

int my_maxhp()

int my_maxmp()

int my_maxpp()

int my_meat()

int my_mp()

string my_name()

string my_path()

familiar my_poke_fam()

int my_pp()

stat my_primestat()

int my_rain()

servant my_servant( servant )

int my_session_adv()

int [item] my_session_items()

int my_session_meat()

string my_sign()

int my_soulsauce()

int my_spleen_use()

int my_storage_meat()

thrall my_thrall()

int my_thunder()

int my_turncount()

vykea my_vykea_companion()


n

float now_to_string( string )

int npc_price( item )

string numberology_prize( int )

float numeric_modifier( [string], string )

float numeric_modifier( item, string )

float numeric_modifier( effect, string )

float numeric_modifier( skill, string )

float numeric_modifier( familiar, string, int, item )


o

boolean outfit( string )

item [int] outfit_pieces( string )

string outfit_tattoo( [string] )

boolean overdrinkint, item )

boolean overdrinkitem, int? )

p

void print( string, [string] )

void print_html( string )

string property_default_valuestring )

boolean property_existsstring, boolean? )

boolean property_has_defaultstring )

int pulls_remaining()

boolean put_closet( int, [item] )

boolean put_display( int, item )

boolean put_shop( int, int, [int], item )

boolean put_shop_using_storage( int, int, [int], item )

boolean put_stash( int, item )

int pvp_attacks_left()


r

int rain_cost( skill )

int random( int )

int raw_damage_absorption()

void refresh_shop()

void refresh_stash()

void refresh_status()

void remove_item_condition( int, item )

string remove_propertystring, boolean? )

boolean rename_propertystring, string )

boolean replace( buffer, int, int, string )

string replace_all( matcher, string )

string replace_first( matcher, string )

buffer replace_string( buffer, string, string )

buffer replace_string( string, string, string )

boolean reprice_shop( int, [int], item )

matcher reset( matcher, [string] )

boolean restore_hp( int )

boolean restore_mp( int )

boolean retrieve_item( int, item )

int [int] reverse_numberology( [int] )

int rollover()

int round( float )

buffer run_choiceint, boolean?, string? )

buffer run_choiceint, string )

buffer run_combat( [string] )

buffer run_turn()

buffer runaway()


s

boolean sell( coinmaster, int, item )

int sell_price( coinmaster, item )

boolean sells_item( coinmaster, item )

string [int] session_logs( [string], int )

void set_auto_attack( int )

void set_length( buffer, int )

void set_location( location )

void set_property( string, string )

int shop_amount( item )

int shop_price( item )

skill skill_modifier( string, string )

int slash_count( item )

int soulsauce_cost( skill )

int spleen_limit()

string [int] split_string( string, [string] )

float square_root( float )

int start( matcher, [int] )

boolean starts_withstring, string )

int stash_amount( item )

stat stat_bonus_today()

stat stat_bonus_tomorrow()

stat stat_modifier( effect, string )

buffer steal()

int stills_available()

void stop_counter( string )

int storage_amount( item )

string string_modifier( [string], string )

skill stun_skill()

string substring( string, int, [int] )

boolean svn_at_head( string )

boolean svn_exists( string )

record svn_info( string )

boolean sweet_synthesis( effect )

item [0] sweet_synthesis_pair( effect )

effect sweet_synthesis_result( item, item )


t

boolean take_closet( int, [item] )

boolean take_display( int, item )

boolean take_shop( [int], item )

boolean take_stash( int, item )

boolean take_storage( int, item )

int tavern( [string] )

buffer throw_item( item )

buffer throw_items( item, item )

int thunder_cost( skill )

buffer time_to_string()

boolean to_boolean( any )

bounty to_bounty( strict_string )

class to_class( strict_string/int )

coinmaster to_coinmaster( strict_string )

effect to_effect( int )

effect to_effect( strict_string )

effect to_effect( skill )

element to_element( strict_string )

familiar to_familiar( int )

familiar to_familiar( strict_string )

float to_float( any )

int to_int( any )

item to_item( strict_string )

item to_item( int )

item to_item( string, int )

string to_json( aggregate )

location to_location( strict_string )

location to_location( int )

string to_lower_case( string )

monster to_monster( strict_string )

phylum to_phylum( string )

string to_plural( item )

servant to_servant( int )

servant to_servant( strict_string )

skill to_skill( effect )

skill to_skill( int )

skill to_skill( strict_string )

slot to_slot( item )

skill to_slot( strict_string )

stat to_stat( string )

string to_string( any )

thrall to_thrall( [string], [int] )

string to_upper_case( string )

string to_url( location )

vykea to_vykea( strict_string )

string today_to_string()

int total_free_rests()

int total_turns_played()

boolean tower_door()

void traceprint( string )

int truncate( float )

int turns_per_cast( skill )

int turns_played()


u

string url_decode( string )

string url_encode( string )

boolean use( int, item )

boolean use_familiar( familiar )

boolean use_servant( servant )

boolean use_skill( int, skill, [string] )

buffer use_skill( skill )

boolean user_confirm( string )

boolean user_confirm( string, int, boolean )


v

boolean visit( coinmaster )

buffer visit_url()

buffer visit_urlstring, boolean?, boolean? )

w

void wait( int )

void waitq( int )

int weapon_hands( item )

stat weapon_type( item )

int weight_adjustment()

boolean white_citadel_available()

boolean [string] who_clan( [string] )

boolean will_usually_dodge()

boolean will_usually_miss()

void write( string )

void writeln( string )


x

string[int] xpath( string, string )