From a27864ec38cd857c6768ecd7468bccaf86f86c5c Mon Sep 17 00:00:00 2001 From: dstein766 Date: Tue, 17 Nov 2026 15:06:32 -0800 Subject: [PATCH 1/3] filter-available-and-solved-1.1 Bump to v1.1 Remove ref to "Mystery Cache". Add confirmation of # of filtered caches. Change "gsak" to "GSAK". --- .../filter-available-and-solved/README.md | 23 +++++++++++++++ .../filter-available-and-solved.lua | 29 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 macros/filter-available-and-solved/filter-available-and-solved/README.md create mode 100644 macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua diff --git a/macros/filter-available-and-solved/filter-available-and-solved/README.md b/macros/filter-available-and-solved/filter-available-and-solved/README.md new file mode 100644 index 0000000..4efef1c --- /dev/null +++ b/macros/filter-available-and-solved/filter-available-and-solved/README.md @@ -0,0 +1,23 @@ +# filter-available-and-solved + +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 +Kai Team. Porting was done via Google Gemini AI. + +## What it needs + +- OpenSAK with macro API version 4 or newer +- Permissions: none + +## How to use it + +1. Run the macro from **Macros → Macro manager…**. + +## Example + +No example needed. + +## Changes + +- 1.0 — first version diff --git a/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua b/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua new file mode 100644 index 0000000..7e7e41a --- /dev/null +++ b/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua @@ -0,0 +1,29 @@ +-- OpenSAK Macro -- +-- Name: Filter Available and Solved +-- Author: OokOok +-- Version: 1.1 +-- Requires-API: 4 +-- Description: Filter the current view for available, unfound, non-owned caches, excluding unsolved Mystery/Unknown caches. +-- Permissions: none + +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 == "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 + table.insert(matching_codes, c.code) + end +end + +if #matching_codes == 0 then + opensak.message("No caches in the current view matched the criteria.", "FilterAvailableAndSolved") +else + opensak.message(opensak.filter{ + codes = matching_codes, + label = "Available & Solved", + } + .. " caches matched.", "FilterAvailableAndSolved") +end From c454006ef04008f5d02aa114899e21e3a6aff839 Mon Sep 17 00:00:00 2001 From: dstein766 Date: Tue, 17 Nov 2026 15:26:17 -0800 Subject: [PATCH 2/3] Delete macros/filter-available-and-solved/filter-available-and-solved directory --- .../filter-available-and-solved/README.md | 23 --------------- .../filter-available-and-solved.lua | 29 ------------------- 2 files changed, 52 deletions(-) delete mode 100644 macros/filter-available-and-solved/filter-available-and-solved/README.md delete mode 100644 macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua diff --git a/macros/filter-available-and-solved/filter-available-and-solved/README.md b/macros/filter-available-and-solved/filter-available-and-solved/README.md deleted file mode 100644 index 4efef1c..0000000 --- a/macros/filter-available-and-solved/filter-available-and-solved/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# filter-available-and-solved - -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 -Kai Team. Porting was done via Google Gemini AI. - -## What it needs - -- OpenSAK with macro API version 4 or newer -- Permissions: none - -## How to use it - -1. Run the macro from **Macros → Macro manager…**. - -## Example - -No example needed. - -## Changes - -- 1.0 — first version diff --git a/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua b/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua deleted file mode 100644 index 7e7e41a..0000000 --- a/macros/filter-available-and-solved/filter-available-and-solved/filter-available-and-solved.lua +++ /dev/null @@ -1,29 +0,0 @@ --- OpenSAK Macro -- --- Name: Filter Available and Solved --- Author: OokOok --- Version: 1.1 --- Requires-API: 4 --- Description: Filter the current view for available, unfound, non-owned caches, excluding unsolved Mystery/Unknown caches. --- Permissions: none - -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 == "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 - table.insert(matching_codes, c.code) - end -end - -if #matching_codes == 0 then - opensak.message("No caches in the current view matched the criteria.", "FilterAvailableAndSolved") -else - opensak.message(opensak.filter{ - codes = matching_codes, - label = "Available & Solved", - } - .. " caches matched.", "FilterAvailableAndSolved") -end From bb2bd54f16b0e84590eeb4b54d45773cfd5679fe Mon Sep 17 00:00:00 2001 From: dstein766 Date: Tue, 17 Nov 2026 15:27:21 -0800 Subject: [PATCH 3/3] Add files via upload --- macros/filter-available-and-solved/README.md | 6 ++++-- .../filter-available-and-solved.lua | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) 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