Custom quest addon for WoW: Classic
The message parameter allows you to specify a phrase or pattern that must be spoken by the player in order to complete an objective.
The full range of Lua patterns are supported for this parameter, but you can use the following examples to get started.
Note that all values for message are case-insensitive, meaning that “happy birthday” and “Happy Birthday” would both work in the first example.
| Value | Result | |
|---|---|---|
| “happy birthday” | The message must contain the phrase “happy birthday” somewhere inside it | |
| “^happy b” | The message must start with the phrase “happy b” | |
| “birthday$” | The message must end with the word “birthday” | |
| “^happy bar mitzvah!$” | The message must be exactly the phrase “happy bar mitzvah | ” with nothing else before or after it |
| Objective | How it’s used |
|---|---|
| say | The message which the player must say in order to complete the objective |
-- Change this pattern to the "message" pattern value you want to test
local pattern = "nothing %w-, nothing %w-"
local function testPattern(message)
local result
if string.match(message, pattern) then
result = "[PASS]" -- This chat message would pass the objective
else
result = "[FAIL]" -- This chat message would NOT pass the objective
end
print(result, message)
end
-- Test any chat messages you want to test against the pattern
testPattern("nothing ventured, nothing gained")
testPattern("nothing spent, nothing saved")
testPattern("this message should not pass")