BIOS
|
|||||||||||
Prints any number of arguments (space separated) at the current cursor position in the current term. All the arguments will automatically be converted to a string using the tostring function, and concatenated, separated by spaces. This function automatically moves to the next line after writing. As well as this, it performs text wrapping, meaning if the string is too big for the term, it will continue writing on the next line. print returns the number of lines it printed. | |||||||||||
Syntax | print(
|
||||||||||
Returns | number linesPrinted | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | BIOS globals | ||||||||||
| |||||||||||
| |||||||||||
|
|
|||||||||||
Identical to print, however the arguments are printed in red, like an error. | |||||||||||
Syntax | printError(
|
||||||||||
Returns | number linesPrinted | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | BIOS globals | ||||||||||
| |||||||||||
| |||||||||||
|
|
|||||||||||
Reads a string of text at the current cursor position in the current term. typingCharacter will automatically be converted to a string using the tostring function. This function moves to the next line after the user presses enter. Optionally, typingCharacter can be specified so that the user's input is hidden and typingCharacter is written in each typed character's place. read returns the string the user entered. Using the history parameter, it is possible to provide a history of previous commands entered (as an array of strings), so that the user can use the up and down arrow keys to browse through them. | |||||||||||
Syntax | read(
|
||||||||||
Returns | string textEntered | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | BIOS globals | ||||||||||
| |||||||||||
|
|
|||||||||||
Pauses execution of the program for time seconds. As it waits for a fixed amount of ticks, time will automatically be rounded up to the nearest multiple of 0.05 seconds. If you are using coroutines or the parallel API, it will only pause execution of the current thread, not the whole program.
|
|||||||||||
Syntax | sleep(
|
||||||||||
Returns | nil | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | BIOS globals | ||||||||||
| |||||||||||
|
|
|||||||||||
Writes text at the current cursor position in the current term. Unlike print, this function does not automatically move to the next line after writing, however it does perform text wrapping, meaning if the string is too big for the term, it will continue writing on the next line. write returns the number of extra lines it printed (i.e. if it did not need to wrap to the next line, it will return 0 ). |
|||||||||||
Syntax | write(
|
||||||||||
Returns | number linesPrinted | ||||||||||
Part of | CC:Tweaked (source) | ||||||||||
API | BIOS globals | ||||||||||
| |||||||||||
| |||||||||||
|
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.