I've been tinkering with gmcp chat and looking at the sources I could find for it. Now.. I found one and it seems like it's at least trying to work after I put it into my gui, but unfortunately when I did and the edits I made (they were not suited to my tabs so they had to happen) it appears I did something wrong. I know that the trigger line that is being called into question in is line 14 of my parser. (at the bottom)
---This is the lua error.
[ LUA ] - object: <Chat Parser> function:<Trigger188>
<[string "Trigger: Chat Parser"]:14: attempt to call method 'appendBuffer' (a nil
value)>
This is something I added to a login trigger: sendGMCP([[Core.Supports.Add ["Comm.Channel 1"] ]])
---This is my EMCO chat tabs
Code: Select all
local EMCO = require("MDK.emco")
chat_con = Geyser.Container:new({
x = "20",
y = "10",
height = "96%",
width = "96%",
},GUI.Box7)
local stylesheet = [[background-color: rgb(0,0,0,255); border-width: 3px; border-style: solid; border-color: rgb(0,78,156); border-radius: 10px;]]
local istylesheet = [[background-color: rgb(0,0,0,255); border-width: 0px; border-style: solid; border-color: rgb(0,0,0,0); border-radius: 10px;]]
chatcon = EMCO:new({
x = "6",
y = "5",
width = "99%",
height = "97%",
scrollbars = true,
inactiveTabFGColor = "dodger_blue",
activeTabFGColor = "white",
tabFontSize = "6",
tabHeight = "32",
tabWidth = "3",
allTab = true,
allTabName = "All",
gap = 2,
consoleColor = "black",
consoles = {
"All",
"Says",
"Tells",
"Orgs",
"Misc",
},
activeTabCSS = stylesheet,
inactiveTabCSS = istylesheet,
}, chat_con)
Code: Select all
local ignore = {"halfling" ,"cyclops","gnoll", "mingruk", "tsol'aa ", "Talus, the caveman", "e glubber", "arcadian", "Adalgar"}
local ignoret = false
for i,v in pairs(ignore) do
if matches[2]:find(v) or matches[2]:find(v:title()) then
ignoret = true
end
end
if not ignoret then
selectString(line,1)
copy()
chat_channels.last:appendBuffer()
chatcon:appendBuffer()
end
-Trigger Group "Chat Processor" with my "Chat Parser" and "Disable Processor". Disable Processor raises the event chat prompt processed which is
Code: Select all
function chat_processed()
disableTrigger("Chat Processor")
end
Code: Select all
function chat_capture()
local ch = gmcp.Comm.Channel.Start
if not chat_channels then check_channels() end
chat_channels.last = "Misc"
for c, t in pairs(chat_channels.types) do
if ch:find(c) then
chat_channels.last = t
break
end
end
enableTrigger("Chat Processor")
end
function check_channels()
chat_channels = chat_channels or {}
chat_channels.last = chat_channels.last or ""
chat_channels.types = {
["newbie"] = "Misc",
["market"] = "Misc",
["ct"] = "Orgs",
["ht"] = "Orgs",
["hts"] = "Orgs",
["hnt"] = "Orgs",
["clt"] = "Tells",
["Party"] = "Tells",
["tell"] = "Tells",
["says"] = "Says",
["ot"] = "Misc"
}
end