Term.scroll

From ComputerCraft Wiki
Jump to: navigation, search
Grid Redstone.png  Function term.scroll
Scrolls the content on terminal window by the supplied number of lines.
Syntax term.scroll(number n)
Returns None
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
Scrolls the text up two lines
Code
term.clear()
term.setCursorPos(1,10)
print("Hello world!")
-- text exists on the 10th line
term.scroll(2)
-- text is now on the 8th line



Grid paper.png  Example
Scrolls the text down three lines
Code
term.clear()
term.setCursorPos(1,3)
print("Hello world!")
-- text exists on the 3rd line
term.scroll(-3)
-- text is now on the 6th line