diff --git a/macros/filter-available-and-solved/README.md b/macros/filter-available-and-solved/README.md index 5891e75..108001e 100644 --- a/macros/filter-available-and-solved/README.md +++ b/macros/filter-available-and-solved/README.md @@ -2,7 +2,7 @@ Filter the current view for available, unfound, non-owned caches, excluding unsolved Mystery/Unknown caches. -This is a port of the gsak FilterAvailableAndSolved macro, originally written by +This is a port of the GSAK FilterAvailableAndSolved macro, originally written by Kai Team. Porting was done via Google Gemini AI. ## What it needs @@ -16,8 +16,10 @@ Kai Team. Porting was done via Google Gemini AI. ## Example -No example needed. +This macro will narrow your current filter (i.e. it adds additional criteria to your current filter). If you want it to operate across the entire database, clear any active filter first. ## Changes - 1.0 — first version +- 1.1 — remove unnecessary reference to "Mystery Cache" when evaluating a cache. + provide popup feedback of # of caches matched. diff --git a/macros/filter-available-and-solved/filter-available-and-solved.lua b/macros/filter-available-and-solved/filter-available-and-solved.lua index 8332b7c..7e7e41a 100644 --- a/macros/filter-available-and-solved/filter-available-and-solved.lua +++ b/macros/filter-available-and-solved/filter-available-and-solved.lua @@ -1,7 +1,7 @@ -- OpenSAK Macro -- -- Name: Filter Available and Solved -- Author: OokOok --- Version: 1.0 +-- Version: 1.1 -- Requires-API: 4 -- Description: Filter the current view for available, unfound, non-owned caches, excluding unsolved Mystery/Unknown caches. -- Permissions: none @@ -10,7 +10,7 @@ local matching_codes = {} -- Loop over caches in the active filter (equivalent to GSAK's $_WHERE) for c in opensak.caches{ fields = { "found", "available", "archived", "owned", "type", "corrected" } } do - local is_mystery = (c.type == "Mystery Cache" or c.type == "Unknown Cache") + local is_mystery = (c.type == "Unknown Cache") local is_unsolved_mystery = is_mystery and (c.corrected == nil) if (not c.found) and c.available and (not c.archived) and (not c.owned) and (not is_unsolved_mystery) then @@ -21,8 +21,9 @@ end if #matching_codes == 0 then opensak.message("No caches in the current view matched the criteria.", "FilterAvailableAndSolved") else - opensak.filter{ + opensak.message(opensak.filter{ codes = matching_codes, label = "Available & Solved", } + .. " caches matched.", "FilterAvailableAndSolved") end