Plugin is super great! Only thing that would make it amazing at this point is if you'd put in the option for /world channel.
I managed to tweak it a bit myself and questions are appearing in /world. Just can't see any guesses that people post back. Any ideas what should I change?
I suppose it ahs to do with something in here or a previous set var on the line which channelId's are allowed into parsing. can't find anything like it yet though:
function parseChat(chatfunc, received)
-- Continue only for the current channel we're watching
if (received["ChatType"] ~= channels[Settings.channel]["channelId"]) then
-- Strip out any leading text (timestamps, if there) the channel name, and EOLs
-- [11/24 01:35:15 PM] [glff] Forestgreenthumb: blah blah blah
-- first, find the start and end positions of the channel name
-- Strip off a leading timestamp, if there is one
local pattern = "^[%d+/%d+%s+[%d:%s]+%a%a] "
_ = string.gsub(tostring(received["Message"]), "<[^>]+>",'')
-- grab the positions of the channel header
pattern = "%[%a+%] "
local channelHeaderStart,channelHeaderEnd = string.find(_,pattern)
-- Skip any "gone offline" or "come online" messages. These do not have the channel banner,
-- so they won't have a start and end. This will also bypass messages sent from the player.
-- The latter works because s apce ("To Kinship") isn't included in the pattern. If Turbine
-- ever changes this, I hope they give us a method to retrieve a channel's name or I can't
-- do user channels easily.
if (channelHeaderStart == nil ) then
if (debug) then
ltprint("skipping extraneous in-channel message")
-- Chop the header out
_ = string.sub( _, channelHeaderEnd )
-- Strip XML and color formatting
_ = string.gsub(_, "<[^>]+>",'')
-- Strip linefeeds
_ = string.gsub(_, "\n",'')
-- get the sender and the chat text
local sender,message = string.match(_,"(%a+):%s(.+)")
-- Save the sender's message but only if they don't currently have one stored
if (storedAnswers[sender] == nil) then
storedAnswers[sender] = message
haveStoredAnswers = true
-- push the answer to the answers listbox, but only if there's an active question
if (questionActive) then
end -- end of function parseChat()