Difference between revisions of "Print"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>StDoodle
Line 1: Line 1:
A simple function.
+
{{
 +
#vardefine:name|print}}{{
 +
#vardefine:return_type|void}}{{
  
<code>
+
FunctionPage|
  [[print()|print]]("My base muscle: " + [[my_basestat()|my_basestat]]($[[stat]][muscle]));
+
name={{#var:name}}|
  [[print()|print]]("My base moxie: " + [[my_basestat()|my_basestat]]($[[stat]][moxie]));
+
function_category=Miscellaneous|
  [[print()|print]]("My base mysticality: " + [[my_basestat()|my_basestat]]($[[stat]][mysticality]));
+
 
  [[comments|// To grab your base main stat, you can:]]
+
function1={{Function|
  [[print()|print]]("My base main stat: " + [[my_basestat()|my_basestat]]([[my_primestat()]]));
+
name={{#var:name}}|
  [[comments|// To grab substats, you can:]]
+
aggregate={{#var:aggregate}}|
  [[print()|print]]("My current muscle substats: " + [[my_basestat()|my_basestat]]($[[stat]][submuscle]));
+
return_type={{#var:return_type}}|
</code>
+
return_also={{#var:return_also}}|
{{Format}}
+
parameter1={{Param|string|message}}|
 +
}}|
 +
 
 +
function2={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|message}}|
 +
parameter2={{Param|string|color}}|
 +
p1desc={{Pspan|message}} is the text to print|
 +
p2desc={{Pspan|color}} is an (optional) html color name or code|
 +
}}|
 +
 
 +
function_description=Print the specified text {{pspan|message}} to the CLI. If the optional {{pspan|color}} parameter is specified and a valid html color code or entity, it will print in that color.|
 +
 
 +
needscode=yes|
 +
 
 +
see_also={{SeeAlso|logprint|print_html}}|
 +
cli_equiv=The CLI commands "fprint," "echo" and "fecho" have similar functionality, minus the color option.|
 +
special= Using an invalid color name or code can cause odd colors to be chosen.|
 +
}}
 +
{{RFI|How does color selection work when the specified color name / entity is invalid?|Didn't print() used to echo on the Adventuring status line? Is the absence of such behavior intentional?}}

Revision as of 20:26, 9 March 2010

needs(code_samples);

Function Syntax

void print(string message )

void print(string message ,string color )

  • message is the text to print
  • color is an (optional) html color name or code

Print the specified text message to the CLI. If the optional color parameter is specified and a valid html color code or entity, it will print in that color.

CLI Equivalent

The CLI commands "fprint," "echo" and "fecho" have similar functionality, minus the color option.

See Also

logprint() | print_html()

Special

Using an invalid color name or code can cause odd colors to be chosen.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific questions have been raised:

  • How does color selection work when the specified color name / entity is invalid?
  • Didn't print() used to echo on the Adventuring status line? Is the absence of such behavior intentional?