Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.04 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.04 KB

lua-windcon

Build status

windcon is a Lua module for interacting with the console on Windows.

local windcon = require('windcon')

-- Clear the screen
windcon.clear()

-- Get the console size
local w, h = windcon.size()

-- Move the cursor to the center
windcon.movecursor(w / 2, h / 2)

-- Hide the cursor
windcon.showcursor(false)

Installation

With Luarocks:

luarocks install windcon

API Reference

windcon.showcursor([state = true])

Sets the visibility of the cursor to state. On success, returns true.

windcon.movecursor(x, y)

Moves the cursor to the given coordinates. On success, returns true; otherwise, returns nil, errmsg.

windcon.clear()

Clears the screen. On success, returns true; otherwise, returns nil, errmsg.

windcon.size()

Returns the width and height of the console.