You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1127 lines
55 KiB
1127 lines
55 KiB
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE muclient>
|
|
<!-- Saved on Monday, November 23, 2015, 8:30 PM -->
|
|
<!-- MuClient version 4.94 -->
|
|
|
|
<!-- Plugin "Themed_Tracker" generated by Plugin Wizard -->
|
|
|
|
<muclient>
|
|
<plugin
|
|
name="Themed_Tracker"
|
|
author="Arcidayne"
|
|
id="2d410b28a4ae912f46f8e75e"
|
|
language="Lua"
|
|
purpose="Customizable quest tracker"
|
|
save_state="y"
|
|
date_written="2015-11-23 20:25:08"
|
|
requires="4.80"
|
|
version="1.1"
|
|
>
|
|
<description trim="y">
|
|
|
|
</description>
|
|
|
|
</plugin>
|
|
|
|
|
|
<!-- Aliases -->
|
|
|
|
<aliases>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? set((?:public|local)) ((?:on|off))$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if "%1" == "public" and "%2" == "on" then
|
|
tracker_db.report_check = 1
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Now reporting to the public!")
|
|
elseif "%1" == "public" and "%2" == "off" then
|
|
tracker_db.report_check = 0
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "No longer reporting to the public!")
|
|
elseif "%1" == "local" and "%2" == "on" then
|
|
tracker_db.local_check = 1
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Now reporting locally!")
|
|
else
|
|
tracker_db.local_check = 0
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "No longer reporting locally!")
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? report(?: (.*))?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 then
|
|
SendNoEcho("%1 " .. tracker_db.last_quest_report)
|
|
else
|
|
SendNoEcho(tracker_db.report_channel .. tracker_db.last_quest_report)
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? addtheme (.*)$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>new_theme("%1")</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? settheme(?: (\w+) ?(\w+)? ?(\w+)?)?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>local name, field, color = string.len("%1"), string.len("%2"), string.len("%3")
|
|
|
|
if name > 0 and field > 0 and color > 0 then
|
|
custom_theme("%1", "%2", "%3")
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Correct syntax is: ", tracker_db.themes[tracker_db.set_theme].special, "", "q settheme [name of theme] [field name] [color]")
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? colors(?: (\w+))?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 then
|
|
color_table("%1")
|
|
else
|
|
color_table()
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? stats$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>q_stats(tracker_db.set_theme)</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? strings$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "start", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_start_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "killed", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_killed_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "failed", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_failed_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "completed", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_completed_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "ready", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_ready_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "reset", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_reset_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "bonus", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_bonus_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Quest ", tracker_db.themes[tracker_db.set_theme].special, "", "nobonus", tracker_db.themes[tracker_db.set_theme].text, "", " string is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.strings.quest_nobonus_string)
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Use ", tracker_db.themes[tracker_db.set_theme].special, "", "'q custom [highlighted term] [string]'", tracker_db.themes[tracker_db.set_theme].text, "", " to set a new string value.")</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? reset(?: (all|current|themes|strings) ?(confirm)?)?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 and string.len("%2") == 0 then
|
|
q_reset("%1")
|
|
elseif string.len("%1") > 0 and string.len("%2") > 0 then
|
|
q_reset("%1", "%2")
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Did you mean qreset self, or ", tracker_db.themes[tracker_db.set_theme].special, "", "'q reset [all|current|themes]'", tracker_db.themes[tracker_db.set_theme].text, "", "?")
|
|
end
|
|
</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? custom(?: (\w+) (.*))?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 then
|
|
local field = "%1"
|
|
if string.len(string.gsub("%2", "^%s", "")) > 0 then
|
|
local strv = string.gsub("%2", "^%s", "")
|
|
set_custom(field, strv) else set_custom(field)
|
|
end
|
|
else
|
|
set_custom()
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? themes?(?: (\d+))?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 then
|
|
set_theme("%1")
|
|
else
|
|
set_theme()
|
|
end</send>
|
|
</alias>
|
|
<alias
|
|
match="^q(?:u|ue|ues|uest)? channel(?: (\w+)\s?)?$"
|
|
enabled="y"
|
|
regexp="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>if string.len("%1") > 0 then
|
|
tracker_db.report_channel = "%1 "
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Tracker now reports to: ", tracker_db.themes[tracker_db.set_theme].special, "", tracker_db.report_channel)
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Tracker reports to: ", tracker_db.themes[tracker_db.set_theme].special, "", tracker_db.report_channel)
|
|
end</send>
|
|
</alias>
|
|
</aliases>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
function custom_report(str)
|
|
str = str:gsub("%%avghours%%", tracker_db.q_db.total_avghours)
|
|
:gsub("%%lasttime%%", tracker_db.q_db.last_time)
|
|
:gsub("%%avgdays%%", tracker_db.q_db.total_avgdays)
|
|
:gsub("%%avgmins%%", tracker_db.q_db.total_avgmins)
|
|
:gsub("%%avgsecs%%", tracker_db.q_db.total_avgsecs)
|
|
:gsub("%%avggold%%", tracker_db.q_db.total_avggold)
|
|
:gsub("%%totalwon%%", tracker_db.q_db.total_won)
|
|
:gsub("%%totallost%%", tracker_db.q_db.total_lost)
|
|
:gsub("%%wonpct%%", tracker_db.q_db.total_wonpct)
|
|
:gsub("%%totalqp%%", tracker_db.q_db.total_qp)
|
|
:gsub("%%publicqp%%", tracker_db.q_db.last_publicqp)
|
|
:gsub("%%avgqp%%", tracker_db.q_db.total_avgqp)
|
|
:gsub("%%totalbonusqp%%", tracker_db.q_db.total_bonusqp)
|
|
:gsub("%%totalpracs%%", tracker_db.q_db.total_practices)
|
|
:gsub("%%totalgold%%", tracker_db.q_db.total_gold)
|
|
:gsub("%%totaltrains%%", tracker_db.q_db.total_trains)
|
|
:gsub("%%totaltp%%", tracker_db.q_db.total_trivia)
|
|
:gsub("%%lastmob%%", tracker_db.q_db.last_mob)
|
|
:gsub("%%lastarea%%", tracker_db.q_db.last_area)
|
|
:gsub("%%lastroom%%", tracker_db.q_db.last_room)
|
|
:gsub("%%lastqp%%", tracker_db.q_db.last_qp)
|
|
:gsub("%%lastgold%%", tracker_db.q_db.last_gold)
|
|
:gsub("%%lastpracs%%", tracker_db.q_db.last_practices)
|
|
:gsub("%%lasttrains%%", tracker_db.q_db.last_trains)
|
|
:gsub("%%lasttp%%", tracker_db.q_db.last_trivia)
|
|
:gsub("%%lastmins%%", tracker_db.q_db.last_mins)
|
|
:gsub("%%lastsecs%%", tracker_db.q_db.last_secs)
|
|
:gsub("%%totalluckyqp%%", tracker_db.q_db.total_luckyqp)
|
|
:gsub("%%wonall%%", tracker_db.q_cumulative.won)
|
|
:gsub("%%lostall%%", tracker_db.q_cumulative.lost)
|
|
:gsub("%%qpall%%", tracker_db.q_cumulative.qp)
|
|
:gsub("%%trainsall%%", tracker_db.q_cumulative.trains)
|
|
:gsub("%%goldall%%", tracker_db.q_cumulative.gold)
|
|
:gsub("%%pracsall%%", tracker_db.q_cumulative.practices)
|
|
:gsub("%%tpall%%", tracker_db.q_cumulative.trivia)
|
|
:gsub("%%wonallpct%%", tracker_db.q_cumulative.wonpct)
|
|
:gsub("%%luckyqpall%%", tracker_db.q_cumulative.luckyqp)
|
|
:gsub("%%bonusqpall%%", tracker_db.q_cumulative.bonusqp)
|
|
:gsub("%%bonuslist%%", tracker_db.q_db.bonus_report)
|
|
|
|
return str
|
|
end
|
|
|
|
-- Theme functions
|
|
|
|
function set_theme(z)
|
|
if z and tonumber(z) > 0 and tonumber(z) <= #tracker_db.themes then
|
|
ColourNote(tracker_db.themes[tonumber(z)].text, "", "Changing theme to: ", tracker_db.themes[tonumber(z)].title, "", tracker_db.themes[tonumber(z)].theme)
|
|
tracker_db.set_theme = tonumber(z)
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
elseif z then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Invalid theme option. Please select a number from " .. tracker_db.themes[tracker_db.set_theme].number, "", "1", tracker_db.themes[tracker_db.set_theme].text, "", " and ", tracker_db.themes[tracker_db.set_theme].number, "", #tracker_db.themes, tracker_db.themes[tracker_db.set_theme].text, "", ".")
|
|
else
|
|
theme_output = {}
|
|
local function insert(f, t)
|
|
table.insert(theme_output, f)
|
|
table.insert(theme_output, "")
|
|
table.insert(theme_output, t)
|
|
end
|
|
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Your current theme is: ", tracker_db.themes[tracker_db.set_theme].title, "", tracker_db.themes[tracker_db.set_theme].theme .. "\n", tracker_db.themes[tracker_db.set_theme].text, "", "You have the following themes available: \n")
|
|
for k,v in ipairs(tracker_db.themes) do
|
|
insert(v.text, v.theme)
|
|
insert(v.number, " (" .. k .. ")\n")
|
|
insert(v.heading, "-")
|
|
insert(v.title, " Quest Stats ")
|
|
insert(v.heading, "-\n")
|
|
insert(v.heading, "Completed ")
|
|
insert(v.bracket, "[")
|
|
insert(v.number, tracker_db.q_cumulative.won)
|
|
insert(v.subtext, "/")
|
|
insert(v.number, (tonumber(tracker_db.q_cumulative.won) + tonumber(tracker_db.q_cumulative.lost)))
|
|
insert(v.bracket, "] [")
|
|
insert(v.number, string.format("%5.1f", tonumber(tracker_db.q_cumulative.wonpct)) .. "%")
|
|
insert(v.bracket, "]\n\n")
|
|
end
|
|
|
|
ColourNote(unpack(theme_output))
|
|
end
|
|
end
|
|
|
|
function new_theme(s)
|
|
local theme_check = 0
|
|
for _, v in ipairs(tracker_db.themes) do
|
|
if string.upper(v.theme) == string.upper(s) then
|
|
theme_check = 1
|
|
break
|
|
end
|
|
end
|
|
|
|
if theme_check == 0 then
|
|
table.insert(tracker_db.themes, {heading = "white", bracket = "white", number = "white", number2 = "white", number3 = "white", text = "white", special = "white", subtext = "white", title = "white", theme = string.gsub(string.lower(s), "^%l", string.upper)})
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "New theme added! (", tracker_db.themes[tracker_db.set_theme].special, "", string.gsub(string.lower(s), "^%l", string.upper), tracker_db.themes[tracker_db.set_theme].text, "", ")")
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "You already have a theme with this name. Use ", tracker_db.themes[tracker_db.set_theme].special, "", "'q set " .. s .. " <field> <color>'", tracker_db.themes[tracker_db.set_theme].text, "", " to change color values.")
|
|
end
|
|
end
|
|
|
|
function custom_theme(name, field, color)
|
|
local theme_name, theme_check, theme_num, field_check = string.gsub(string.lower(name), "^%l", string.upper), 0, 0, 0
|
|
for i, v in pairs(tracker_db.themes) do
|
|
if string.upper(v.theme) == string.upper(name) then
|
|
theme_check = 1
|
|
theme_num = i
|
|
break
|
|
end
|
|
end
|
|
|
|
if theme_check == 1 then
|
|
for i,_ in pairs(tracker_db.themes[theme_num]) do
|
|
if string.lower(i) == string.lower(field) then
|
|
field_check = 1
|
|
end
|
|
end
|
|
if field_check == 1 then
|
|
tracker_db.themes[theme_num][field] = color
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Field ", tracker_db.themes[tracker_db.set_theme].special, "", field, tracker_db.themes[tracker_db.set_theme].text, "", " set to ", color, "", color, tracker_db.themes[tracker_db.set_theme].text, "", ". If different than what you were expecting, check spelling!")
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Field ", tracker_db.themes[tracker_db.set_theme].special, "", field, tracker_db.themes[tracker_db.set_theme].text, "", " not found! Options are: ", tracker_db.themes[tracker_db.set_theme].subtext, "", "heading, bracket, number, number2, number3, special, subtext, text, title", tracker_db.themes[tracker_db.set_theme].text, "", ". Please try again.")
|
|
end
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Theme ", tracker_db.themes[tracker_db.set_theme].special, "", name, tracker_db.themes[tracker_db.set_theme].text, "", " not found. Did you ", tracker_db.themes[tracker_db.set_theme].special, "", "addtheme", tracker_db.themes[tracker_db.set_theme].text, "", " it yet?")
|
|
end
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function OnPluginBroadcast (msg, id, name, text)
|
|
if (id == '3e7dedbe37e44942dd46d264') then
|
|
if (text == 'comm.quest') then
|
|
local res, qinfo = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","comm.quest")
|
|
|
|
assert(loadstring("quest = " .. qinfo or "")) ()
|
|
|
|
if quest["action"] == "start" then
|
|
QuestStart(quest.targ, quest.room, quest.area, quest.timer, tracker_db.set_theme)
|
|
elseif quest["action"] == "fail" then
|
|
QuestFail(tracker_db.set_theme)
|
|
elseif quest["action"] == "killed" then
|
|
QuestKilled(tracker_db.set_theme)
|
|
elseif quest["action"] == "comp" then
|
|
QuestComp(quest.qp, quest.tierqp, quest.pracs, quest.trains, quest.tp, quest.mccp, quest.lucky, quest.double, quest.daily, quest.totqp, quest.gold, quest.completed, quest.wait, tracker_db.set_theme)
|
|
elseif quest["action"] == "ready" then
|
|
QuestReady(tracker_db.set_theme)
|
|
elseif quest["action"] == "timeout" then
|
|
QuestFail(tracker_db.set_theme)
|
|
elseif quest["action"] == "reset" then
|
|
QuestReset(tracker_db.set_theme)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function color_table(color)
|
|
local output = {}
|
|
local function insert(f, b, t)
|
|
table.insert(output, f)
|
|
table.insert(output, b)
|
|
table.insert(output, t)
|
|
end
|
|
if color and tracker_db.color_table[color] then
|
|
for _,v in ipairs(tracker_db.color_table[color]) do
|
|
insert("", v, " ")
|
|
insert("white", "", " -- " .. v .. "\n")
|
|
end
|
|
elseif color and not tracker_db.color_table[color] then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Available colors are: ", tracker_db.themes[tracker_db.set_theme].special, "", "blue, green, pink, red, yellow, brown, grey, white, orange, purple")
|
|
else
|
|
for i, v in pairs(tracker_db.color_table) do
|
|
insert("white", "", string.gsub(string.lower(i), "^%l", string.upper) .. " colors\n")
|
|
for _,v in ipairs(v) do
|
|
insert("", v, " ")
|
|
end
|
|
insert("", "", "\n\n")
|
|
end
|
|
end
|
|
ColourNote(unpack(output))
|
|
end
|
|
|
|
function add_stats(t, k, v)
|
|
t[k] = t[k] + (v or 1)
|
|
end
|
|
|
|
function sub_stats(t, k, v)
|
|
t[k] = t[k] - (v or 1)
|
|
end
|
|
|
|
function QuestStart(t, r, a, c, z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
|
|
tracker_db.q_db.last_mob, tracker_db.q_db.last_area, tracker_db.q_db.last_room, tracker_db.q_db.last_time = t, a, r, c
|
|
|
|
tracker_db.q_db.current_start = os.time()
|
|
tracker_db.q_db.last_qp = 0
|
|
tracker_db.q_db.last_publicqp = 0
|
|
tracker_db.q_db.last_bonusqp = 0
|
|
tracker_db.q_db.last_luckyqp = 0
|
|
tracker_db.q_db.last_gold = 0
|
|
tracker_db.q_db.last_trains = 0
|
|
tracker_db.q_db.last_practices = 0
|
|
tracker_db.q_db.last_trivia = 0
|
|
tracker_db.q_db.last_date = os.date("%A %B %d, %Y %I:%M %p")
|
|
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest Information\nTarget: ", special, "", t .. "\n", text, "", "Room: ", special, "", r .. "\n", text, "", "Area: ", special, "", a .. "\n", text, "", "Time limit: ", special, "", c .. " minutes\n", head, "", tracker_db.heading)
|
|
|
|
tracker_db.current_quest_report = custom_report(tracker_db.strings.quest_start_string)
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. tracker_db.current_quest_report)
|
|
end
|
|
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function QuestFail(z)
|
|
|
|
add_stats(tracker_db.q_db, "total_lost")
|
|
add_stats(tracker_db.q_cumulative, "lost")
|
|
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
local total_q, total_qall = tracker_db.q_db.total_lost + tracker_db.q_db.total_won, tracker_db.q_cumulative.lost + tracker_db.q_cumulative.won
|
|
|
|
tracker_db.q_db.total_wonpct = string.format("%0.1f", 100*(tonumber(tracker_db.q_db.total_won)/tonumber(total_q)))
|
|
tracker_db.q_db.total_avgqp = (string.format("%0.1f", tonumber(tracker_db.q_db.total_qp)/tonumber(total_q)))
|
|
tracker_db.q_cumulative.wonpct = (string.format("%0.1f", 100*(tonumber(tracker_db.q_cumulative.won)/tonumber(total_qall))))
|
|
|
|
if tracker_db.local_check == 1 then
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest failed.\nFor updated quest stats, type ", brack, "", "'", subtext, "", "q stats", brack, "", "'\n", head, "", tracker_db.heading)
|
|
end
|
|
|
|
tracker_db.last_quest_report = custom_report(tracker_db.strings.quest_failed_string)
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. tracker_db.last_quest_report)
|
|
end
|
|
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function QuestKilled(z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
|
|
if tracker_db.local_check == 1 then
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest target killed! Complete your quest!\n", head, "", tracker_db.heading)
|
|
end
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. custom_report(tracker_db.strings.quest_killed_string))
|
|
end
|
|
end
|
|
|
|
function QuestComp(q, tq, p, tr, tp, m, l, d, da, qp, g, c, w, z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
local bonuses = (tonumber(qp) - tonumber(l) - tonumber(m) - tonumber(q) - tonumber(tq))
|
|
|
|
tracker_db.q_db.current_end = os.time()
|
|
tracker_db.q_db.last_trains = tonumber(tr)
|
|
tracker_db.q_db.last_trivia = tonumber(tp)
|
|
tracker_db.q_db.last_publicqp = tonumber(qp)
|
|
tracker_db.q_db.last_practices = tonumber(p)
|
|
tracker_db.q_db.last_gold = tonumber(g)
|
|
tracker_db.q_db.last_qp = tonumber(qp)
|
|
|
|
|
|
add_stats(tracker_db.q_db, "total_trains", tonumber(tr))
|
|
add_stats(tracker_db.q_db, "total_trivia", tonumber(tp))
|
|
add_stats(tracker_db.q_db, "total_qp", tonumber(qp))
|
|
add_stats(tracker_db.q_db, "total_bonusqp", bonuses)
|
|
add_stats(tracker_db.q_db, "total_practices", tonumber(p))
|
|
add_stats(tracker_db.q_db, "total_luckyqp", tonumber(l))
|
|
add_stats(tracker_db.q_db, "total_gold", tonumber(g))
|
|
add_stats(tracker_db.q_db, "total_won")
|
|
|
|
if tonumber(tr) > 0 or tonumber(tp) > 0 or tonumber(p) > 0 then
|
|
tracker_db.q_db.bonus_report = custom_report(tracker_db.strings.quest_bonus_string)
|
|
else
|
|
tracker_db.q_db.bonus_report = custom_report(tracker_db.strings.quest_nobonus_string)
|
|
end
|
|
|
|
add_stats(tracker_db.q_cumulative, "trains", tonumber(tr))
|
|
add_stats(tracker_db.q_cumulative, "trivia", tonumber(tp))
|
|
add_stats(tracker_db.q_cumulative, "qp", qp)
|
|
add_stats(tracker_db.q_cumulative, "bonusqp", bonuses)
|
|
add_stats(tracker_db.q_cumulative, "practices", tonumber(p))
|
|
add_stats(tracker_db.q_cumulative, "luckyqp", tonumber(l))
|
|
add_stats(tracker_db.q_cumulative, "gold", tonumber(g))
|
|
add_stats(tracker_db.q_cumulative, "won")
|
|
|
|
local total_q, total_qall = tracker_db.q_db.total_won + tracker_db.q_db.total_lost, tracker_db.q_cumulative.won + tracker_db.q_cumulative.lost
|
|
|
|
tracker_db.q_cumulative.wonpct = string.format("%0.1f", (100 * (tonumber(tracker_db.q_cumulative.won)/tonumber(total_qall))))
|
|
tracker_db.q_db.total_wonpct = string.format("%0.1f", (100 * (tonumber(tracker_db.q_db.total_won)/tonumber(total_q))))
|
|
tracker_db.q_db.total_avggold = string.format("%0.1f", (tonumber(tracker_db.q_db.total_gold)/tonumber(tracker_db.q_db.total_won)))
|
|
tracker_db.q_db.total_avgqp = string.format("%0.2f", tonumber(tracker_db.q_db.total_qp)/tonumber(total_q))
|
|
|
|
-- Time calculations, old-fashioned (primitive!) way for simplicity
|
|
|
|
tracker_db.q_db.current_time = (tracker_db.q_db.current_end - tracker_db.q_db.current_start)
|
|
add_stats(tracker_db.q_db, "totalsec", tracker_db.q_db.current_time)
|
|
tracker_db.q_db.current_days = math.floor(tracker_db.q_db.current_time/86400)
|
|
sub_stats(tracker_db.q_db, "current_time", (tracker_db.q_db.current_days*86400))
|
|
|
|
tracker_db.q_db.current_hours = math.floor(tracker_db.q_db.current_time/3600)
|
|
sub_stats(tracker_db.q_db,"current_time", (tracker_db.q_db.current_hours*3600))
|
|
|
|
tracker_db.q_db.current_minutes = math.floor(tracker_db.q_db.current_time/60)
|
|
tracker_db.q_db.current_seconds = tracker_db.q_db.current_time - (tracker_db.q_db.current_minutes*60)
|
|
|
|
add_stats(tracker_db.q_db, "total_secs", tracker_db.q_db.current_seconds)
|
|
if tracker_db.q_db.total_secs > 59 then
|
|
add_stats(tracker_db.q_db, "total_mins")
|
|
sub_stats(tracker_db.q_db, "total_secs", 60)
|
|
end
|
|
|
|
add_stats(tracker_db.q_db, "total_mins", tracker_db.q_db.current_minutes)
|
|
if tracker_db.q_db.total_mins > 59 then
|
|
add_stats(tracker_db.q_db, "total_hours")
|
|
sub_stats(tracker_db.q_db, "total_mins", 60)
|
|
end
|
|
|
|
add_stats(tracker_db.q_db, "total_hours", tracker_db.q_db.current_hours)
|
|
if tracker_db.q_db.total_hours > 23 then
|
|
add_stats(tracker_db.q_db, "total_days")
|
|
sub_stats(tracker_db.q_db, "total_hours", 24)
|
|
end
|
|
|
|
add_stats(tracker_db.q_db, "total_days", tracker_db.q_db.current_days)
|
|
|
|
tracker_db.q_db.last_mins = tracker_db.q_db.current_minutes
|
|
tracker_db.q_db.last_secs = tracker_db.q_db.current_seconds
|
|
|
|
tracker_db.q_db.total_avgtime = (tracker_db.q_db.totalsec/total_q)
|
|
tracker_db.q_db.total_avgsecs = tracker_db.q_db.total_avgtime%60
|
|
tracker_db.q_db.total_avgmins = ((tracker_db.q_db.total_avgtime - tracker_db.q_db.total_avgsecs)/60)%60
|
|
tracker_db.q_db.total_avghours = (tracker_db.q_db.total_avgtime - tracker_db.q_db.total_avgsecs - (tracker_db.q_db.total_avgmins*60))/3600
|
|
|
|
-- Reporting
|
|
|
|
if tracker_db.local_check == 1 then
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest Completed\nRewards: ", num, "", qp, text, "", " qp, ", num, "", g, text, "", " gold.\nExtras: ", num, "", tr, text, "", " trn, ", num, "", p, text, "", " prc, ", num, "", tp, text, "", " trv.\nTime: ", num, "", tracker_db.q_db.last_mins, text, "", " mins, ", num, "", tracker_db.q_db.last_secs, text, "", " secs.\nFor updated quest stats, type ", brack, "", "'", subtext, "", "q stats", brack, "", "'\n", head, "", tracker_db.heading)
|
|
end
|
|
|
|
tracker_db.last_quest_report = custom_report(tracker_db.strings.quest_completed_string)
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. tracker_db.last_quest_report)
|
|
end
|
|
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function QuestReady(z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
|
|
if tracker_db.local_check == 1 then
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest ready!\n", head, "", tracker_db.heading)
|
|
end
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. custom_report(tracker_db.strings.quest_ready_string))
|
|
end
|
|
end
|
|
|
|
function QuestReset(z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
|
|
if tracker_db.local_check == 1 then
|
|
ColourNote(head, "", tracker_db.heading, text, "", "Quest reset!\n", head, "", tracker_db.heading)
|
|
end
|
|
|
|
if tracker_db.report_check == 1 then
|
|
SendNoEcho(tracker_db.report_channel .. custom_report(tracker_db.strings.quest_reset_string))
|
|
end
|
|
end
|
|
|
|
function q_stats(z)
|
|
local theme = tracker_db.themes[z]
|
|
local brack, head, num, num2, num3, special, subtext, title, text = theme.bracket, theme.heading, theme.number, theme.number2, theme.number3, theme.special, theme.subtext, theme.title, theme.text
|
|
local gold_format = ""
|
|
|
|
if tracker_db.q_db.total_gold > 999999 then
|
|
gold_format = string.format("%5.2f", tonumber(tracker_db.q_db.total_gold)/1000000) .. "m"
|
|
else
|
|
gold_format = string.format("%6.0f", tonumber(tracker_db.q_db.total_gold))
|
|
end
|
|
|
|
ColourTell(head, "", "-------------------------------") NoteStyle(5) ColourTell(title, "", " Quest Stats ") NoteStyle(0) ColourTell(head, "", "-------------------------------\n")
|
|
ColourNote(text, "", "Q Completed ", brack, "", "[", num, "", string.format("%6.0f", tonumber(tracker_db.q_cumulative.won)), brack, "", "] ", text, "", "Q Failed ", brack, "", "[", num, "", string.format("%6.0f", tonumber(tracker_db.q_cumulative.lost)), brack, "", "] ", text, "", "Success Ratio ", brack, "", "[", num, "", string.format("%5.1f", tonumber(tracker_db.q_cumulative.wonpct)) .. "%", brack, "", "]\n")
|
|
ColourTell(head, "", " --") NoteStyle(5) ColourTell(title, "", "Since " .. string.format( "%39s", tracker_db.q_db.total_reset)) NoteStyle(0) ColourTell(head, "", "--\n")
|
|
ColourNote(text, "", "Complete", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_won)), brack, "", "] ", text, "", "Failed ", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_lost)), brack, "", "] ", text, "", "Won Pct", brack, "", " [", num, "", string.format( "%5.1f", tonumber(tracker_db.q_db.total_wonpct)) .. "%", brack, "", "]")
|
|
ColourNote(text, "", "QP Tot ", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_qp)), brack, "", "] ", text, "", "Avg QP ", brack, "", "[", num, "", string.format( "%6.1f", tonumber(tracker_db.q_db.total_avgqp)), brack, "", "] ", text, "", "Lucky QP", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_luckyqp)), brack, "", "] ", text, "", "Bonus ", brack, "", "[", num, "", string.format("%6.0f", tonumber(tracker_db.q_db.total_bonusqp)), brack, "", "]")
|
|
ColourNote(text, "", "Pracs ", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_practices)), brack, "", "] ", text, "", "Trains ", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_trains)), brack, "", "] ", text, "", "Gold ", brack, "", "[", num, "", gold_format, brack, "", "] ", text, "", "Trivia ", brack, "", "[", num, "", string.format( "%6.0f", tonumber(tracker_db.q_db.total_trivia)), brack, "", "]")
|
|
ColourNote(text, "", "Total Time ", brack, "", "[", num, "", string.format( "%3.0f", tonumber(tracker_db.q_db.total_days)), brack, "", " days ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.total_hours)), brack, "", " hrs ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.total_mins)), brack, "", " mins ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.total_secs)), brack, "", " secs ]")
|
|
ColourNote(text, "", "Average Time ", brack, "", "[ ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.total_avgmins)), brack, "", " mins ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.total_avgsecs)), brack, "", " secs ]\n")
|
|
ColourTell(head, "", " --") NoteStyle(5) ColourTell(title, "", "Last Q " .. string.format( "%39s", tracker_db.q_db.last_date)) NoteStyle(0) ColourTell(head, "", "--\n")
|
|
ColourNote(text, "", "Target ", brack, "", "[", num, "", tracker_db.q_db.last_mob, subtext, "", " in ", num, "", tracker_db.q_db.last_area, brack, "", " / ", num, "", tracker_db.q_db.last_room, brack, "", "]")
|
|
ColourNote(text, "", "Details ", brack, "", "[", num, "", tracker_db.q_db.last_qp, subtext, "", " qp ", brack, "", "/ ", num, "", tracker_db.q_db.last_gold, subtext, "", " gld ", brack, "", "/ ", num, "", tracker_db.q_db.last_trains, subtext, "", " trn ", brack, "", "/ ", num, "", tracker_db.q_db.last_practices, subtext, "", " prc ", brack, "", "/ ", num, "", tracker_db.q_db.last_trivia, subtext, "", " trv", brack, "", "]")
|
|
ColourNote(text, "", "Completed In ", brack, "", "[", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.last_mins)), subtext, "", " mins ", num, "", string.format( "%2.0f", tonumber(tracker_db.q_db.last_secs)), subtext, "", " secs ", brack, "", "]")
|
|
ColourTell(head, "", "-----------------------------------------------------------------------", brack, "", "[") NoteStyle(5) ColourTell(title, "", tracker_db.version) NoteStyle(0) ColourTell(brack, "", "]\n\n")
|
|
end
|
|
|
|
|
|
function q_reset(p, c)
|
|
if p == "all" and c == "confirm" then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Resetting everything back to default!")
|
|
tracker_db.q_cumulative = reset_db.q_cumulative
|
|
tracker_db.q_db = reset_db.q_db
|
|
tracker_db.q_db.total_reset = os.date("%A %B %d, %Y %I:%M %p")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Tracker cumulative and current stats reset! (Boy, that was fast!)")
|
|
elseif p == "all" and not c then
|
|
ColourNote("yellow", "firebrick", "WARNING: This will reset ALL your cumulative and current stats and cannot be undone!")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Type ", tracker_db.themes[tracker_db.set_theme].special, "", "'q reset all confirm'", tracker_db.themes[tracker_db.set_theme].text, "", " to continue.")
|
|
elseif p == "current" and c == "confirm" then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Resetting current totals!")
|
|
tracker_db.q_db = reset_db.q_db
|
|
tracker_db.q_db.total_reset = os.date("%A %B %d, %Y %I:%M %p")
|
|
elseif p == "current" and not c then
|
|
ColourNote("yellow", "firebrick", "WARNING: This will reset your current stats and cannot be undone!")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Type ", tracker_db.themes[tracker_db.set_theme].special, "", "'q reset current confirm'", tracker_db.themes[tracker_db.set_theme].text, "", " to continue.")
|
|
elseif p == "themes" and c == "confirm" then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Resetting default themes!")
|
|
tracker_db.themes = reset_db.themes
|
|
elseif p == "themes" and not c then
|
|
ColourNote("yellow", "firebrick", "WARNING: This will erase custom themes and reset themes to default and cannot be undone!")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Type ", tracker_db.themes[tracker_db.set_theme].special, "", "'q reset themes confirm'", tracker_db.themes[tracker_db.set_theme].text, "", " to continue.")
|
|
elseif p == "strings" and c == "confirm" then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Resetting default strings!")
|
|
tracker_db.strings = reset_db.strings
|
|
elseif p == "strings" and not c then
|
|
ColourNote("yellow", "firebrick", "WARNING: This will erase custom strings and reset them to default and cannot be undone!")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Type ", tracker_db.themes[tracker_db.set_theme].special, "", "'q reset strings confirm'", tracker_db.themes[tracker_db.set_theme].text, "", " to continue.")
|
|
end
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function set_custom(v, s)
|
|
if v and s then
|
|
if v == "start" then tracker_db.strings.quest_start_string = s
|
|
elseif v == "completed" then tracker_db.strings.quest_completed_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "failed" then tracker_db.strings.quest_failed_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "killed" then tracker_db.strings.quest_killed_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "ready" then tracker_db.strings.quest_ready_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "reset" then tracker_db.strings.quest_reset_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "bonus" then tracker_db.strings.quest_bonus_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
elseif v == "nobonus" then tracker_db.strings.quest_nobonus_string = s
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", string.gsub(string.lower(v), "^%l", string.upper) .. " set to: ", tracker_db.themes[tracker_db.set_theme].special, "", s)
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "That's not an option. Please select from: ", tracker_db.themes[tracker_db.set_theme].special, "", "start, completed, failed, killed, ready, reset, current, last")
|
|
end
|
|
elseif v and not s then
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Why do you want an empty string? The command is: ", tracker_db.themes[tracker_db.set_theme].special, "", "'q custom <type> <custom string>'")
|
|
else
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].text, "", "Your options are:")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avggold%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current Average Gold")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalwon%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current completed quest total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%wonall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall completed quest total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totallost%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current failed quest total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lostall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall failed quest total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%wonpct%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current won percentage")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%wonallpct%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall won percentage")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current quest point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%qpall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall quest point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%publicqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Public quest point display (*shrug*, it's an option)*")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avgqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current average quest points per quest")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalbonusqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current bonus quest points total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%bonusqpall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall bonus quest point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalpracs%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current practice total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%pracsall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall practice total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalgold%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current gold total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%goldall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall gold total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totaltrains%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current trains total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%trainsall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall trains total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totaltp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current trivia point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%tpall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall trivia point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%totalluckyqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current lucky quest point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%luckyqpall%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Overall lucky quest point total")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avghours%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Average hours")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avgdays%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Average days")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avgmins%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Average minutes")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%avgsecs%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Average seconds")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastmob%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current/last quest mob")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastarea%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current/last quest area")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastroom%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current/last quest room")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastqp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last quest point reward")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastgold%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last gold reward")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastpracs%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last practices reward")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lasttrains%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last trains reward")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lasttp%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last trivia point reward")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastmins%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last completed quest time (minutes)")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lastsecs%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Last completed quest time (seconds)")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%lasttime%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Current/Last time limit on quest")
|
|
ColourNote(tracker_db.themes[tracker_db.set_theme].special, "", string.format("%-20s", "%bonuslist%"), tracker_db.themes[tracker_db.set_theme].text, "", "-- Bonus list output\n")
|
|
end
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
|
|
function OnPluginInstall()
|
|
require 'serialize'
|
|
|
|
reset_db = {
|
|
|
|
color_table = {
|
|
|
|
pink = {
|
|
"pink",
|
|
"lightpink",
|
|
"hotpink",
|
|
"deeppink",
|
|
"palevioletred",
|
|
"mediumvioletred"
|
|
},
|
|
|
|
red = {
|
|
"lightsalmon",
|
|
"salmon",
|
|
"darksalmon",
|
|
"lightcoral",
|
|
"indianred",
|
|
"crimson",
|
|
"firebrick",
|
|
"darkred",
|
|
"red"
|
|
},
|
|
|
|
orange = {
|
|
"orangered",
|
|
"tomato",
|
|
"coral",
|
|
"darkorange",
|
|
"orange"
|
|
},
|
|
|
|
yellow = {
|
|
"yellow",
|
|
"lightyellow",
|
|
"lemonchiffon",
|
|
"lightgoldenrodyellow",
|
|
"papayawhip",
|
|
"moccasin",
|
|
"peachpuff",
|
|
"palegoldenrod",
|
|
"khaki",
|
|
"darkkhaki",
|
|
"gold"
|
|
},
|
|
|
|
brown = {
|
|
"cornsilk",
|
|
"blanchedalmond",
|
|
"bisque",
|
|
"navajowhite",
|
|
"wheat",
|
|
"burlywood",
|
|
"tan",
|
|
"rosybrown",
|
|
"sandybrown",
|
|
"goldenrod",
|
|
"darkgoldenrod",
|
|
"peru",
|
|
"chocolate",
|
|
"saddlebrown",
|
|
"sienna",
|
|
"brown",
|
|
"maroon"
|
|
},
|
|
|
|
purple = {
|
|
"lavender",
|
|
"thistle",
|
|
"plum",
|
|
"violet",
|
|
"orchid",
|
|
"fuchsia",
|
|
"magenta",
|
|
"mediumorchid",
|
|
"mediumpurple",
|
|
"blueviolet",
|
|
"darkviolet",
|
|
"darkorchid",
|
|
"darkmagenta",
|
|
"purple",
|
|
"indigo",
|
|
"slateblue",
|
|
"darkslateblue",
|
|
"mediumslateblue"
|
|
},
|
|
|
|
green = {
|
|
"greenyellow",
|
|
"chartreuse",
|
|
"lawngreen",
|
|
"lime",
|
|
"limegreen",
|
|
"palegreen",
|
|
"lightgreen",
|
|
"mediumspringgreen",
|
|
"springgreen",
|
|
"mediumseagreen",
|
|
"seagreen",
|
|
"forestgreen",
|
|
"green",
|
|
"darkgreen",
|
|
"yellowgreen",
|
|
"olivedrab",
|
|
"olive",
|
|
"darkolivegreen",
|
|
"mediumaquamarine",
|
|
"darkseagreen",
|
|
"lightseagreen",
|
|
"darkcyan",
|
|
"teal"
|
|
},
|
|
|
|
blue = {
|
|
"aqua",
|
|
"cyan",
|
|
"lightcyan",
|
|
"paleturquoise",
|
|
"aquamarine",
|
|
"turquoise",
|
|
"mediumturquoise",
|
|
"darkturquoise",
|
|
"cadetblue",
|
|
"steelblue",
|
|
"lightsteelblue",
|
|
"powderblue",
|
|
"lightblue",
|
|
"skyblue",
|
|
"lightskyblue",
|
|
"deepskyblue",
|
|
"dodgerblue",
|
|
"cornflowerblue",
|
|
"mediumslateblue",
|
|
"royalblue",
|
|
"blue",
|
|
"mediumblue",
|
|
"darkblue",
|
|
"navy",
|
|
"midnightblue"
|
|
},
|
|
|
|
white = {
|
|
"white",
|
|
"snow",
|
|
"honeydew",
|
|
"mintcream",
|
|
"azure",
|
|
"aliceblue",
|
|
"ghostwhite",
|
|
"whitesmoke",
|
|
"seashell",
|
|
"beige",
|
|
"oldlace",
|
|
"floralwhite",
|
|
"ivory",
|
|
"antiquewhite",
|
|
"linen",
|
|
"lavenderblush",
|
|
"mistyrose"
|
|
},
|
|
|
|
grey = {
|
|
"gainsboro",
|
|
"lightgrey",
|
|
"silver",
|
|
"darkgray",
|
|
"gray",
|
|
"dimgray",
|
|
"lightslategray",
|
|
"slategray",
|
|
"darkslategray",
|
|
"black"
|
|
}
|
|
},
|
|
|
|
themes = {
|
|
{
|
|
bracket = "lightcoral",
|
|
heading = "firebrick",
|
|
number = "gold",
|
|
number2 = "sandybrown",
|
|
number3 = "orangered",
|
|
special = "salmon",
|
|
subtext = "orange",
|
|
text = "orangered",
|
|
title = "ghostwhite",
|
|
theme = "Fire"
|
|
},
|
|
|
|
{
|
|
bracket = "darkslateblue",
|
|
heading = "lightskyblue",
|
|
number = "powerblue",
|
|
number2 = "royalblue",
|
|
number3 = "mediumblue",
|
|
special = "lightsteelblue",
|
|
subtext = "lightskyblue",
|
|
text = "cornflowerblue",
|
|
title = "azure",
|
|
theme = "Cool"
|
|
},
|
|
|
|
{
|
|
bracket = "saddlebrown",
|
|
heading = "green",
|
|
number = "lightgreen",
|
|
number2 = "limegreen",
|
|
number3 = "seagreen",
|
|
special = "peru",
|
|
subtext = "olivedrab",
|
|
text = "yellowgreen",
|
|
title = "honeydew",
|
|
theme = "Nature"
|
|
},
|
|
|
|
{
|
|
bracket = "darkmagenta",
|
|
heading = "darkmagenta",
|
|
number = "violet",
|
|
number2 = "ghostwhite",
|
|
number3 = "ghostwhite",
|
|
special = "plum",
|
|
subtext = "mediumorchid",
|
|
text = "mediumorchid",
|
|
title = "ghostwhite",
|
|
theme = "Violet"
|
|
},
|
|
|
|
{
|
|
bracket = "teal",
|
|
heading = "powerblue",
|
|
number = "mediumaquamarine",
|
|
number2 = "ghostwhite",
|
|
number3 = "ghostwhite",
|
|
special = "skyblue",
|
|
subtext = "ghostwhite",
|
|
text = "powerblue",
|
|
title = "white",
|
|
theme = "Sea"
|
|
},
|
|
|
|
{
|
|
bracket = "orange",
|
|
heading = "lightcoral",
|
|
number = "peachpuff",
|
|
number2 = "ghostwhite",
|
|
number3 = "ghostwhite",
|
|
special = "ghostwhite",
|
|
subtext = "ghostwhite",
|
|
text = "coral",
|
|
title = "ghostwhite",
|
|
theme = "Peach"
|
|
},
|
|
|
|
{
|
|
bracket = "darkmagenta",
|
|
heading = "indigo",
|
|
number = "ghostwhite",
|
|
number2 = "ghostwhite",
|
|
number3 = "ghostwhite",
|
|
special = "darkmagenta",
|
|
subtext = "mediumpurple",
|
|
text = "ghostwhite",
|
|
title = "ghostwhite",
|
|
theme = "Grape"
|
|
},
|
|
|
|
{
|
|
bracket = "red",
|
|
heading = "white",
|
|
number = "silver",
|
|
number2 = "silver",
|
|
number3 = "silver",
|
|
special = "darkslategray",
|
|
subtext = "silver",
|
|
text = "ghostwhite",
|
|
title = "ghostwhite",
|
|
theme = "Rogues"
|
|
},
|
|
},
|
|
|
|
set_theme = 1, -- Set by default
|
|
current_quest_report = "@D[@x123Quest@D] @x214Find: @W%lastmob% @x214Room: @W%lastroom% @x214Area: @W%lastarea% @x214Time: @W%lasttime%$C",
|
|
last_quest_report = "@D[@x123Quest@D] @x214No quests have been run!$C",
|
|
version = "1.1",
|
|
|
|
strings = {
|
|
quest_start_string = "@D[@x123Quest@D] @x123Find: @W%lastmob% @x123Room: @W%lastroom% @x123Area: @W%lastarea% @x123Time: @W%lasttime%$C",
|
|
quest_completed_string = "@D[@x123Quest@D] @x123Last Mob: @D[@W%lastmob%@D] @x123in @D[@W%lastroom%@D] @x123in @D[@W%lastarea%@D] @x123Time: @D[@W%lastmins%@x123m @W%lastsecs%@x123s@D] @x123Base Rewards: @D[@W%publicqp%@x123qp, @W%lastgold%@x123gold@D] @x123Bonuses: @D[%bonuslist%@D]$C",
|
|
quest_failed_string = "@D[@x123Quest@D] @x123Failed!$C",
|
|
quest_killed_string = "@D[@x123Quest@D] @x123Target killed!$C",
|
|
quest_ready_string = "@D[@x123Quest@D] @x123Ready!$C",
|
|
quest_reset_string = "@D@x123Quest@D] @x123Reset!$C",
|
|
quest_bonus_string = "@W%lasttrains%@x123trn @W%lastpracs%@x123prc @W%lasttp%@x123tp",
|
|
quest_nobonus_string = "@x123No bonuses",
|
|
},
|
|
|
|
report_check = 1, -- enabled by default
|
|
local_check = 1, -- enabled by default
|
|
report_channel = "gt ", -- Set to default
|
|
heading = "--------------------------------------------------------------\n",
|
|
|
|
q_db = {
|
|
bonus_quests = 0,
|
|
current_start = 0,
|
|
current_end = 0,
|
|
current_time = 0,
|
|
current_days = 0,
|
|
current_hours = 0,
|
|
current_minutes = 0,
|
|
current_seconds = 0,
|
|
totalsec = 0,
|
|
total_avgtime = 0,
|
|
total_avggold = 0, -- %avggold%
|
|
total_won = 0, -- %totalwon%
|
|
total_lost = 0, -- %totallost%
|
|
total_wonpct = 0, -- %wonpct%
|
|
total_qp = 0, -- %totalqp%
|
|
last_publicqp = 0, -- %publicqp%
|
|
total_avgqp = 0, -- %avgqp%
|
|
total_bonusqp = 0, -- %totalbonusqp%
|
|
total_practices = 0, -- %totalpracs%
|
|
total_gold = 0, -- %totalgold%
|
|
total_trains = 0, -- %totaltrains%
|
|
total_trivia = 0, -- %totaltp%
|
|
total_avghours = 0, -- %%avghours%
|
|
total_avgdays = 0, -- %avgdays%
|
|
total_avgmins = 0, -- %avgmins%
|
|
total_avgsecs = 0, -- %avgsecs%
|
|
total_days = 0,
|
|
total_hours = 0,
|
|
total_mins = 0,
|
|
total_secs = 0,
|
|
last_mob = "N/A", -- %lastmob%
|
|
last_area = "N/A", -- %lastarea%
|
|
last_room = "N/A", -- %lastroom%
|
|
last_time = 0, -- %%lasttime%%
|
|
last_qp = 0, -- %lastqp%
|
|
last_gold = 0, -- %lastgold%
|
|
last_practices = 0, -- %lastpracs%
|
|
last_trains = 0, -- %lasttrains%
|
|
last_trivia = 0, -- %lasttp%
|
|
last_mins = 0, -- %lastmins%
|
|
last_secs = 0, -- %lastsecs%
|
|
qpgoal = 0,
|
|
qpgoal_text = "---",
|
|
qps_needed = 0,
|
|
quests_needed = 0,
|
|
bonus_report = "",
|
|
total_luckyqp = 0, -- %totalluckyqp%
|
|
last_date = "", -- os.date("%A %B %d, %Y %I:%M %p")
|
|
total_reset = "" -- os.date("%A %B %d, %Y %I:%M %p")
|
|
},
|
|
|
|
q_cumulative = {
|
|
won = 0, -- %wonall%
|
|
lost = 0, -- %lostall%
|
|
qp = 0, -- %qpall%
|
|
trains = 0, -- %trainsall%
|
|
gold = 0, -- %goldall%
|
|
practices = 0, -- %pracsall%
|
|
trivia = 0, -- %tpall%
|
|
wonpct = 0, -- %wonallpct%
|
|
luckyqp = 0, -- %luckyqpall%
|
|
bonusqp = 0, -- %bonusqpall%
|
|
}
|
|
}
|
|
if GetVariable("atracker") then
|
|
loadstring (GetVariable("atracker")) ()
|
|
else
|
|
tracker_db = {}
|
|
tracker_db = reset_db
|
|
tracker_db.q_db.total_reset = os.date("%A %B %d, %Y %I:%M %p")
|
|
SetVariable("atracker", serialize.save("tracker_db"))
|
|
end
|
|
end
|
|
]]>
|
|
</script>
|
|
|
|
|
|
<!-- Plugin help -->
|
|
|
|
<aliases>
|
|
<alias
|
|
script="OnHelp"
|
|
match="^q(?:u|ue|ues|uest)? help$"
|
|
enabled="y"
|
|
regexp="y"
|
|
>
|
|
</alias>
|
|
</aliases>
|
|
|
|
<script>
|
|
<![CDATA[
|
|
function OnHelp ()
|
|
--world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
|
|
local function fmt(i, d)
|
|
return ColourNote("limegreen", "", i .. "\n", "white", "", d .. "\n")
|
|
end
|
|
|
|
ColourNote("green", "", "Themed Tracker Help", "gray", "", " (Original written by GdAnGuS, rewritten and revamped by Arcidayne)\n")
|
|
fmt("q[uest] stats", "Displays quest stats in a \"score\" format.")
|
|
fmt("q[uest] report [channel]", "Reports to your default channel without arguments, or the channel of your choice.")
|
|
fmt("q[uest] custom [type] [string]", "Allows you to customize strings. Without arguments, will display fields you can set.")
|
|
fmt("q[uest] theme [theme option]", "Sets your current theme to a new theme. Without arguments, displays all your existing themes.")
|
|
fmt("q[uest] addtheme [name]", "Allows you to add a new color theme. It will default all colors to white, so be sure to set the new colors.")
|
|
fmt("q[uest] settheme [name] [field] [color]", "Set an existing theme's field to a different color.")
|
|
fmt("q[uest] colors [color]", "Displays a color palette broken into color groups. The [color] argument allows you to break that color down by color name.")
|
|
fmt("q[uest] strings", "Displays current them settings in raw colors format.")
|
|
fmt("q[uest] custom [string type] [string]", "Allows you to customize your field strings similar to how you customize prompts. Use without arguments to a list of settable field names. An example would be: 'q custom completed @DQuest Completed! @w%lastqp% @Dquest points earned!'")
|
|
fmt("q[uest] channel [channel]", "Sets your report channel. Without arguments, displays your current report channel.")
|
|
fmt("q[uest] set[public|local] [off|on]", "Sets whether you use your report channel (public) and local (score table).")
|
|
fmt("q[uest] reset [current|all|themes|strings]", "Resets your current stats, cumulative stats, themes, and strings, respectively.\n")
|
|
ColourNote("green", "", "If you run into any problems, please note Arcidayne on personal board. Be detailed!")
|
|
end
|
|
]]>
|
|
</script>
|
|
|
|
</muclient>
|