Difference between pages "Miscellaneous ASH Features" and "To stat"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Icon315
 
imported>Bale
m
 
Line 1: Line 1:
{{TOCright}}
+
{{
==Special Syntax Functions==
+
#vardefine:name|to_stat}}{{
 +
#vardefine:return_type|stat}}{{
  
'''[[notify]]'''
+
FunctionPage|
 +
name={{#var:name}}|
  
'''[[import]]'''
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|int|convert}}|
 +
}}|
  
==Comments==
+
function_description=When supplied a string, returns the stat that corresponds to the specified parameter {{pspan|convert}}.|
  
Adding '''[[Comments]]''' to your code can make it much easier to maintain, and helps other users understand what's going on.
+
needscode=yes|
  
==Errors==
+
see_also={{SeeAlso|to_item|to_skill|to_monster}}|
  
For help when things go wrong, please see the page on [[ASH Errors]].
+
special=If no match is found for {{pspan|convert}}, this function returns $stat[ none ].|
 +
}}
  
==Additional Script Uses==
+
[[Category:Datatype Conversions]]
 
 
In addition to regular menu-or-CLI-selectable scripts and relay override scripts, you can also use a script for:
 
 
 
* Between Battle (betweenBattleScript)
 
* Buy (buyScript)
 
* Chatbot (chatbotScript)
 
* Counters (counterScript)
 
* Login (loginScript)
 
* Logout (logoutScript)
 
* Planting (plantingScript)
 
* Post Ascension (postAscensionScript)
 
* Pre Ascension (preAscensionScript)
 
* Profit (profitScript?)
 
* Recovery (recoveryScript)
 
* ??
 
 
 
==A little CLI help==
 
 
 
Two CLI commands are of great use to ASH scripters:
 
* [[ashref]] allows one to get a list of ASH functions
 
* [[ash (CLI)|ash]] or [[ash (CLI)|ashq]] allows one to run ASH directly on the CLI.
 
 
 
{{RFI|Where are all the other places a script can be used? Help plox.}}
 

Revision as of 05:22, 22 May 2010

needs(code_samples);

Function Syntax

stat to_stat(int convert )

When supplied a string, returns the stat that corresponds to the specified parameter convert.

See Also

to_item() | to_skill() | to_monster()

Special

If no match is found for convert, this function returns $stat[ none ].