Print html: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
mNo edit summary
imported>Bale
mNo edit summary
 
Line 6: Line 6:


name={{#var:name}}|
name={{#var:name}}|
function_category=Miscellaneous|


function1={{Function|
function1={{Function|
Line 33: Line 32:
see_also={{SeeAlso|print}}|
see_also={{SeeAlso|print}}|
}}
}}
[[Category:Miscellaneous Functions]]

Latest revision as of 05:30, 22 May 2010

Function Syntax

void print_html(string html )

  • html is the HTML string you want printed.

This is a modified version of print() that allows you to format strings as if they were HTML. Font size, tables, font colours, etc can all be specified. This can produce some interesting effects in scripts. For example, producing pleasing layouts, such as tables for informational scripts and introducing multiple colours.

Code Sample

This is code taken from That FN Ninja's dwarven factory script that displays a line using subtly different colours for each letter.

print_html("<font size=5><b><font color=000000>P</font><font color=00002D>u</font><font color=00005A>z</font>
<font color=000087>z</font><font color=0000B4>l</font><font color=0000E1>e</font> <font color=0000E1>S</font>
<font color=0000C0>o</font><font color=0000A0>l</font><font color=000080>v</font><font color=000060>e</font>
<font color=000040>d</font><font color=000020>!</font><font color=000000>!</font></b></font>");

See Also

print()