Repository navigation
Replies: 1 comment
|
Hi @ianwok Here 2 hints but I'm not sure if they fulfill your requirements as I can not test it on my side. If the filter matters this is quicker as you only load one field and not all data of each cache local expected = 1 If you want to run over full DB SQL is much faster `-- Checks that user_sort over found caches is exactly 1..N. if #bad == 0 then |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I posted on the OpenSAK Facebook page about my first attempt at writing an OpenSAK macro and it was suggested I open a discussion here in order to show another example macro. Any comments welcome if anything's is wrong or can be done better (I had to rename from .lua to .txt to attach here because of a phone issue)
checkusort.txt
It is a very simple and short macro. I found the example macros useful and also the built-in API reference. It would perhaps be useful to include online access to a recommended Lua reference.
I use the UserSort to store a “find number” for each cache in my Finds database. GSAK provides support to update this field, either by editing or by double clicking on the field to allocate the next number. Mistakes sometimes happen and the macro just checks this field for all caches in the database to confirm there is a sequential incrementing find number.
At the moment this is of limited use in OpenSAK as the UserSort field can not be allocated or modified.
One other comment I would make - it would be useful if the bottom panel of the Macro window (where output messsges are shown) could be cleared as when you are running a macro multiple times it gets a little confusing. Perhaps a button at top of window?
All reactions