와우 (lua에서) 용 애드온을 프로그래밍하려고합니다. 특정 단어를 기반으로하는 채팅 필터입니다. 나는 단어의 대/소문자 조합이 배열과 일치하도록 대소 문자를 구분하지 않도록이 단어의 배열을 가져 오는 방법을 알아낼 수 없습니다. 어떤 아이디어라도 대단히 감사하겠습니다. 감사!루아에서 대소 문자를 구별하지 않는 배열
local function wordFilter(self,event,msg)
local keyWords = {"word","test","blah","here","code","woot"}
local matchCount = 0;
for _, word in ipairs(keyWords) do
if (string.match(msg, word,)) then
matchCount = matchCount + 1;
end
end
if (matchCount > 1) then
return false;
else
return true;
end
end