Print html

From Kolmafia
Revision as of 23:55, 10 March 2010 by imported>Grotfang
Jump to navigation Jump to search

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()