|
|
|
@ -22,8 +22,22 @@
|
|
|
|
|
</alias>
|
|
|
|
|
</aliases>
|
|
|
|
|
|
|
|
|
|
<!-- Script -->
|
|
|
|
|
<!-- Triggers -->
|
|
|
|
|
|
|
|
|
|
<triggers>
|
|
|
|
|
<trigger
|
|
|
|
|
name="gqAlert"
|
|
|
|
|
enabled="y"
|
|
|
|
|
keep_evaluating="y"
|
|
|
|
|
group="Notifier"
|
|
|
|
|
match="^Global Quest\: Global quest \# (.*?) has been declared for levels ([0-9]*?) to ([0-9]*?)\.$"
|
|
|
|
|
regexp="y"
|
|
|
|
|
script="sendAlert"
|
|
|
|
|
sequence="100" >
|
|
|
|
|
</trigger>
|
|
|
|
|
</triggers>
|
|
|
|
|
|
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
<![CDATA[
|
|
|
|
@ -77,9 +91,32 @@ function pageRequest(req, protocol)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function getGQAlertMessage(wildcards)
|
|
|
|
|
-- get gq information
|
|
|
|
|
local gqid = wildcards[1]
|
|
|
|
|
local lower = tonumber(wildcards[2])
|
|
|
|
|
local upper = tonumber(wildcards[3])
|
|
|
|
|
|
|
|
|
|
-- get character information
|
|
|
|
|
local ret, datastring = CallPlugin("3e7dedbe37e44942dd46d264", "gmcpdata_as_string", "char.status")
|
|
|
|
|
pcall(loadstring("status_table = "..datastring))
|
|
|
|
|
local char_level = tonumber(status_table["level"])
|
|
|
|
|
|
|
|
|
|
-- verification and message creation
|
|
|
|
|
if char_level >= lower and char_level <= upper then
|
|
|
|
|
return "GQ ALERT#" .. gqid
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function sendAlert(name, line, wildcards)
|
|
|
|
|
local wc = wildcards[1] or ""
|
|
|
|
|
if name ~= "TestAlert" then
|
|
|
|
|
if name == "gqAlert" then
|
|
|
|
|
msg = getGQAlertMessage(wildcards)
|
|
|
|
|
if msg == nil then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
msg = string.format(alertFormat, url.escape(msg))
|
|
|
|
|
elseif name ~= "TestAlert" then
|
|
|
|
|
local wc = wildcards[1] or ""
|
|
|
|
|
for _,v in ipairs(triggerLines) do
|
|
|
|
|
if name == v.name then
|
|
|
|
|
msg = string.format(alertFormat, url.escape(v.message .. wc))
|
|
|
|
|