> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Console

> 运行时输出和控制台控件。

<div className="real-category-page">
  运行时输出和控制台控件。

  ## 可用函数

  <CardGroup cols={2}>
    <Card title="rconsoleclear" href="./rconsoleclear">
      当存在 console window 时清除 current Windows console screen buffer。如果不存在 console window，call 会直接返回且不执行任何操作。
    </Card>

    <Card title="rconsolecreate" href="./rconsolecreate">
      当不存在 console window 时，为 process allocate Windows console。如果 console window 已存在，call 会直接返回且不执行任何操作。allocation 后，function 会将 stdout redirect 到 console output，将 stdin redirect 到 console input。
    </Card>

    <Card title="rconsoledestroy" href="./rconsoledestroy">
      清除当前 Windows console screen buffer，隐藏 console window，并使用 console detachment 将进程从 console 分离。如果不存在 console window，该调用会直接返回且不执行任何操作。
    </Card>

    <Card title="rconsoleerr" href="./rconsoleerr">
      将 console text attribute 设置为 error text color 后，通过 stdout 向当前 Windows console 写入零个或多个值。值会使用 Lua string conversion 转换，并用 tab 字符分隔，随后会将 text attribute 设置为 default console text color。如果不存在 console window，该调用会直接返回，不会转换或写入任何内容。
    </Card>

    <Card title="rconsolehide" href="./rconsolehide">
      使用 Windows console visibility update 和 hide mode 隐藏当前 Windows console window。该 function 不调用 console detachment，因此不会从 console 分离，也不会销毁 console。如果不存在 console window，该调用会直接返回且不执行任何操作。
    </Card>

    <Card title="rconsoleinfo" href="./rconsoleinfo">
      将 console text attribute 设置为 info text color 后，通过 stdout 向当前 Windows console 写入零个或多个值。值会使用 Lua string conversion 转换，并用 tab 字符分隔，随后会将 text attribute 设置为 default console text color。如果不存在 console window，该调用会直接返回，不会转换或写入任何内容。
    </Card>

    <Card title="rconsoleinput" href="./rconsoleinput">
      在清除 console input state 并忽略 input 直到下一个 newline 后，使用 console input 从 stdin 读取一条 line 时会 yield。返回的 string 通过 string return 推入，并且不包含结尾 newline。如果不存在 console window，该调用会返回且不带 values。
    </Card>

    <Card title="rconsolename" href="./rconsolename">
      使用 Windows console title update 设置当前 Windows console window 的 title。第一个 argument 必须是 string，并且会在 console existence check 之前检查。如果 string check 成功后不存在 console window，该调用会直接返回且不执行任何操作。
    </Card>

    <Card title="rconsoleprint" href="./rconsoleprint">
      不更改 console text attribute，通过 stdout 向当前 Windows console 写入零个或多个值。值会使用 Lua string conversion 转换，并用 tab 字符分隔。该 function 不会添加 newline。如果不存在 console window，该调用会直接返回，不会转换或写入任何内容。
    </Card>

    <Card title="rconsoleshow" href="./rconsoleshow">
      使用 Windows console visibility update 和 show mode 显示当前 Windows console window。该 function 不会创建 console。如果不存在 console window，调用会直接返回且不执行任何操作。
    </Card>

    <Card title="rconsolewarn" href="./rconsolewarn">
      使用 warning console text attribute，通过 stdout 向当前 Windows console 写入零个或多个值。如果不存在 console window，调用会直接返回，不会转换或写入任何内容。存在 console 时，每个 argument 会用 Lua string conversion 转换，用 tab 字符连接，然后通过 runtime value 写入。如果 Lua string conversion 抛出 error，rconsolewarn 不会捕获它。该 function 会在写入前将 console text attribute 设置为 FOREGROUND\_RED | FOREGROUND\_GREEN | FOREGROUND\_INTENSITY，之后设置为 default console text color。它不会添加 newline，不会添加 warning prefix，不会创建或显示 console，也不会调用 Luau warn 或 Roblox Output。consolewarn 是同一个 function 的 alias。
    </Card>
  </CardGroup>
</div>
