Quake-Style Chat Console
Hit ` and a chat pane opens above the output pane with every
tell and channel message you’ve received; hit it again and it’s gone. Tells
can’t scroll away under combat spam, and they’re all in one place when you
come back to the keyboard.
rune.bind("`", function() rune.pane.toggle("chat")end)
local style = rune.stylelocal function mirror(tag, color, name, msg) rune.pane.write("chat", color("[" .. tag .. "]") .. " " .. style.bold(name) .. ": " .. msg)end
rune.trigger.regex("^(\\w+) tells you: (.+)$", function(m) mirror("Tell", style.cyan, m[1], m[2])end, { group = "chat-console" })
rune.trigger.regex("^You tell (\\w+): (.+)$", function(m) mirror("Tell", style.cyan, "-> " .. m[1], m[2])end, { group = "chat-console" })
rune.trigger.regex("^(\\w+) \\[(\\w+)\\]: (.+)$", function(m) mirror(m[2], style.yellow, m[1], m[3])end, { group = "chat-console" })
rune.ui.layout({ type = "column", children = { { type = "pane", name = "chat", size = 10, hidden = true }, { type = "pane", name = "output", border = "none" }, { type = "input" }, { type = "bar", name = "status" }, },})How it works
Section titled “How it works”- The pane accumulates writes whether visible or
not;
`only toggles visibility. A bound printable key fires only on an empty input line, so typing backtick mid-sentence still works, and a hidden pane takes no screen space. - The triggers mirror matching lines into the
pane, restyled compactly. They don’t gag, so chat still appears inline
too. Add
return falsein the handlers to move messages instead of copying them. - The layout puts the pane first in the root column, 10
lines tall, declared
hidden = trueso the console starts closed. While it is hidden, the output pane reclaims that height.
Variations
Section titled “Variations”- Match your game’s channel formats. The third trigger’s
Name [Channel]: textpattern is the part most likely to differ. /group chat-console offsilences the mirroring without touching the pane or the bind.- For timestamps, prepend
style.gray(os.date("[%H:%M] "))inmirror.
Related: Panes · Triggers · Key Bindings · Layout & UI