1 posts
Posted 16 December 2013 - 01:17 PM
I'm new to Lua and I don't know how to leave a blank line with nothing on when printing words onto a computer screen (for example in a list, leaving a line)…
Help would be appreciated!
8543 posts
Posted 16 December 2013 - 01:53 PM
Change the cursor position.
--# get current cursor position.
local x, y = term.getCursorPos()
--# set cursor position to the beginning of the line two down.
term.setCursorPos(1, y + 2)
If you need the screen to scroll, you'll have to add that in yourself. That code will move the cursor as long as it's at least two lines above the bottom of the screen.
1688 posts
Location
'MURICA
Posted 16 December 2013 - 09:18 PM
If you're making a simple console application, doing
print("")
works as well.
500 posts
Posted 16 December 2013 - 09:21 PM
If you're making a simple console application, doing
print("")
works as well.
I believe this even works:
print()
882 posts
Location
Behind you.
Posted 16 December 2013 - 10:46 PM
Yes it does Symmetryc, or at least in the base Lua it did.
I used it a lot in some basic scripts.