Files

31 lines
1.2 KiB
Lua

local here = arg[0]:match("^(.*)/") or "."
dofile(here .. "/lib.lua")
local W, ER, S, P = H.W, H.ER, H.S, H.P
local function strip(s) return (L53.gsub(L53.gsub(s or "", "|c%x%x%x%x%x%x%x%x", ""), "|r", "")) end
W.Tick(3, 3)
local want = os.getenv("GUIDE")
local rate = tonumber(os.getenv("RATE") or "2")
ER.SetXPRate(rate, true)
if os.getenv("PROFS") then for p in string.gfind(os.getenv("PROFS"), "[^,]+") do ER.SetProf(p, true) end end
for _, g in ipairs(S.Guides()) do
if g.fast and g.name == want or g.name == "Fast " .. want then
ER.StartGuide(S.Key(g), true, true)
local n = 0
for i = 1, S.Count() do
local st = S.Step(i)
if S.Fits(st) then
n = n + 1
local parts = {}
for _, e in ipairs(st.elements) do
local l = S.Line(st, e)
local kind = e.kind
if kind == "G" then table.insert(parts, "G(" .. tostring(e.zone) .. " " .. tostring(e.x) .. "," .. tostring(e.y) .. ")")
elseif l then table.insert(parts, kind .. ":" .. strip(l.text or "")) else table.insert(parts, kind .. (e.id and ("#" .. e.id) or "")) end
end
print(string.format("%3d %s", i, table.concat(parts, " | ")))
end
end
print("steps shown", n, "of", S.Count())
end
end