Let's walk through setting up Mudlet to separate channel output for [chat] in its own window so it won't be lost with combat spam.
sysConnectionEvnet
function make_chat_window()
chat_window = Geyser.UserWindow:new({
name = "chat_window",
titleText = "CHATS",
docked = true,
height = "5c",
dockPosition = "top",
autoWrap = true,
})
chat_window:setFontSize(getFontSize())
return 1
end
make_chat_window()
[chat]
if(chat_window)
then
selectCurrentLine()
copy()
chat_window:appendBuffer()
end
To add timestamps to your chat capture window, replace
copy() chat_window:appendBuffer()
in the previous examples with
echo("chat_window", string.format("%s: %s\n", getTime(true), getSelection()))
Check the Mudlet Lua documentation to see more formatting options for getTime().
To capture additional channels to the same window simply add more capture patterns to the trigger.
Here's an example of adding additional styling to the chat capture window.
NOTE: Requires Mudlet 4.10+ and Linux - will not work on older Mudlet or MacOS/Windows
chat_window:setStyleSheet fragment: chat_window = Geyser.UserWindow:new({
name = "chat_window",
titleText = "CHATS",
docked = true,
height = "5c",
dockPosition = "top",
})
chat_window:setStyleSheet([[
background-color: black;
border-width: 2px;
border-color: #005c28;
border-style: groove;
border-radius: 2;
]])
chat_window:setFontSize(getFontSize())
return 1
end
make_chat_window()