Difference between revisions of "Textutils (API)"
From ComputerCraft Wiki
m (Added NeedsWork.) |
m (Number (type) [gone] -> int (type)) |
||
Line 8: | Line 8: | ||
!style="background:#EEE" width="*"|Description | !style="background:#EEE" width="*"|Description | ||
|- | |- | ||
− | |[[textutils.slowPrint|textutils.slowPrint]]([[string (type)|string]] text, [[ | + | |[[textutils.slowPrint|textutils.slowPrint]]([[string (type)|string]] text, [[int (type)|int]] rate) |
|Slowly prints the text. Only difference is, it leaves a new-line after it. | |Slowly prints the text. Only difference is, it leaves a new-line after it. | ||
|- | |- | ||
− | |[[textutils.slowWrite|textutils.slowWrite]]([[string (type)|string]] text, [[ | + | |[[textutils.slowWrite|textutils.slowWrite]]([[string (type)|string]] text, [[int (type)|int]] rate) |
|Slowly writes the text. | |Slowly writes the text. | ||
|- | |- | ||
− | |[[textutils.formatTime|textutils.formatTime]]([[ | + | |[[textutils.formatTime|textutils.formatTime]]([[int (type)|int]] time, [[boolean (type)|bool]] TwentyFourHour) |
|Put a time into it, and it spews it out in a different format. For example: | |Put a time into it, and it spews it out in a different format. For example: | ||
local time = os.time() | local time = os.time() |
Revision as of 18:52, 30 November 2012
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: Needs |
Text utilities is used to mess around with text easier.
Its functions include:
Method name | Description |
---|---|
textutils.slowPrint(string text, int rate) | Slowly prints the text. Only difference is, it leaves a new-line after it. |
textutils.slowWrite(string text, int rate) | Slowly writes the text. |
textutils.formatTime(int time, bool TwentyFourHour) | Put a time into it, and it spews it out in a different format. For example:
local time = os.time() print(textutils.formatTime(time, false)) |
textutils.tabulate(table table, table table2, ...) | Prints tables in an ordered form. Each table is a row, columns' width is auto-adjusted. |
textutils.pagedTabulate(table table, table table2, ...) | <no description given> |
textutils.pagedPrint(string string, string confirmation_lines) | Prints a string onto the screen, but waits for confirmation before scrolling down. |
textutils.serialize(table table) | Returns a string representation of the table t for storage or transmission. |
textutils.unserialize(string text) | Returns a table reassembled from the string s. |
textutils.urlEncode(string text) | Makes a string safe to encode into a url. Spaces are replaced with +s. Unsafe characters such as '\', '£' and '}' are translated into ASCII code and preceded with a % for transmission. For reference visit: [1]. |