Skip to content

console

The console table allows mods to interact with an actual Windows (or Wine) console window.

The physical window is created the first time you call any console.


console.show

console.show() -> ()

Opens the console window and brings it to the foreground.


console.hide

console.hide() -> ()

Hides / closes the console window. The text is kept even when hidden.


console.setTitle

console.setTitle(title:string) -> ()

Sets the currently allocated console title to title.


console.write

console.write(text: string) -> ()

Writes text to the console without adding a new line.


console.writeLine

console.writeLine(text: string) -> ()

Writes text followed by a new line.


console.clear

console.clear() -> ()

Wipes everything currently in the console.


console.read

console.read() -> string

Waits for the player to type a line and press Enter, then returns what they typed.

console.read pauses your script until input is received, to avoid this you can wrap it in task.spawn.

console.write("What's your name? ")
local name = console.read()
console.writeLine("Hi, " .. name .. "!")