Files
pfQuest xpGuideandClaude Sonnet 5.5 ef2f4f34b3 pfQuest xpGuide 1.0.0
A leveling guide for WoW 1.12 players of pfQuest, based on Easy Route by stealthzi (MIT).
See README.md and CHANGES.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XfR1apt9f3R7SxBKB2FF2D
2026-11-16 14:47:43 +08:00

70 lines
2.9 KiB
Lua

-- texlua run.lua <addon> <race> <class> <level> <mode>
local here = arg[0]:match("^(.*)/") or "."
local W = dofile(here .. "/wow.lua")
local ER = W.ER
local out = {}
local function P(s) table.insert(out, s) end
local function try(label, fn, ...)
local ok, err = xpcall(fn, debug.traceback, ...)
if not ok then table.insert(W.errors, "[" .. label .. "] " .. tostring(err)) end
return ok, err
end
local S = ER.Steps
local info = S and S.Info and S.Info()
P("running: " .. tostring(info and (info.group .. "\\" .. info.name) or "none") .. " mode=" .. tostring(ER.db and ER.db.mode))
-- Walk every visit of the route at its level, every step: title, target, lines, tips; then advance.
local guides = ER.RouteGuides and ER.RouteGuides() or {}
P("route visits: " .. #guides)
local stepsSeen = 0
for gi, g in ipairs(guides) do
W.level = math.max(1, math.floor(g.lo))
W.zone = g.visit.zone
try("StartGuide " .. g.name, function() ER.StartGuide(S.Key(g), nil, true) end)
W.Fire("PLAYER_LEVEL_UP", W.level)
W.Fire("ZONE_CHANGED_NEW_AREA")
W.Fire("QUEST_LOG_UPDATE")
W.Tick(0.5, 6)
local count = 0
try("Count " .. g.name, function() count = S.Count() end)
local guard = 0
while guard < 600 do
guard = guard + 1
local step
local ok = try("Current " .. g.name, function() step = S.Current() end)
if not ok or not step then break end
stepsSeen = stepsSeen + 1
try("Title " .. g.name .. " #" .. tostring(S.Position()), function() S.Title(step) end)
try("Target " .. g.name .. " #" .. tostring(S.Position()), function() S.Target() end)
if ER.RefreshSimple then try("RefreshSimple " .. g.name, ER.RefreshSimple) end
if ER.Refresh then try("Refresh", ER.Refresh) end
if ER.ArrowUpdate then try("ArrowUpdate", ER.ArrowUpdate) end
W.Tick(0.2, 2)
local before = S.Position()
try("Next " .. g.name, function() S.Next() end)
if S.Position() == before and S.Current() == step then break end
-- level up gradually through the visit
if g.hi and W.level < g.hi and guard % 8 == 0 then W.level = W.level + 1; W.Fire("PLAYER_LEVEL_UP", W.level) end
end
end
P("steps walked: " .. stepsSeen)
-- every mode through the zone logic
for _, key in ipairs(ER.MODE_ORDER or {}) do
end
try("SelfTest", function() ER.SelfTest() end)
if ER.db and ER.db.selftest then for _, l in ipairs(ER.db.selftest.results) do if l:find("ERROR") then table.insert(W.errors, "[selftest] " .. l) end end end
local seen = {}
for _, e in ipairs(W.errors) do
local _, line_end = e:find("^[^\n]*")
local key = e:sub(1, line_end):gsub("%[[^%]]*%] ", "", 1):gsub("#%d+", "")
if not seen[key] then seen[key] = true; P("ERROR " .. e:sub(1, 1500)) end
end
P("errors: " .. #W.errors .. " (" .. (function() local n = 0 for _ in pairs(seen) do n = n + 1 end return n end)() .. " unique)")
local unk = {}
for k, n in pairs(W.unknown) do table.insert(unk, k) end
table.sort(unk)
P("unknown globals: " .. table.concat(unk, " "))
print(table.concat(out, "\n"))