console.height readonly property

The console.height property gets the current console height in character. That value depends on the current console window size.

Example

local console = require "console" console.color = "lightmagenta" -- get the line in the middle of the console local ypos = math.floor(console.height/2) -- scroll "Hello World !" on that line for i=1,console.width-13 do if i>1 then console.locate(i-1, ypos) console.write(" ") end console.locate(i, ypos) console.write("Hello World !") sys.sleep(1) end