Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

+1 vote
613 views

 

http://www.geocaching.com/geocache/GC5KWQ7_challenge-wet-wet-wet

Could someone make a challenge-checker for me.

The task is to take: Found 25 caches with the attributes svimming and wading

If the user dont have 25 caches with those two attributes it would be great if the script show how many days the geocacher have the most. Also great if the script listed up the caches the user have takes so other users can see some caches they might aim to take.


I have a little trail of challenges here in Harstad and it would be great if i could have a challengechecker for this cache also. Make the task to control the logs better, some users hide their stats.

in Miscellaneous by Team Karlsen (4.2k points)
edited by Team Karlsen

2 Answers

+1 vote
 
Best answer

This checker should do the trick.

by GentlePurpleRain (1.4k points)
selected by Team Karlsen
I think that is incorrect. The checker says that I have 124 attribute and that is the sum of 98 and 26 for the two attributes. I would guess that I have logged caches with both and a GSAK test shows that
I have  15 find with both attributes and 109 at least on attribute. If you count the one with both you get 124 as the checker says.
The checker looks for 25 attributes in total not on 25 different caches
I think the wording on the output from the checker is a little confusing.  When it says "you have found X attributes", it really means, "you have found X caches with the attributes".  I will update it so it is clearer.
It still correctly checks if you meet the challenge requirements.
I is still wrong. a get 124 but have only logged 109 different cache with atleast one of the two attributes. 124 i the sum of the tow attributes
When i looked at the code you count the number you add the all numbers in the cacheCountForAttribute array to the output ie you count the number of attributes

You also create a cachesWithAttribute array I suspect that i could be used to count  the correct value. I suspect the number of elem ts in that array is the number of caches with at-least one attribute but it is never used only populated in the processAttributes function
Yes, you're right.  Sorry; I didn't quite understand your first comment, so I got confused about what you were saying.

The script doesn't take into account caches with more than one of the required attributes.  I think most challenges don't care if you get multiple attributes on a single cache, but it would be significantly harder to implement if we have to take overlap into account.

The cacheWithAttribute array wouldn't really help much -- it's just a list of all the caches that have a given attribute.  I guess the script could try to cross-reference all of these to see if there is overlap...

I guess Team Karlsen should decide if this checker meets their purpose.  If not, it can be deleted.
It is easy to add the number of caches checker capability. only 11 rows of code
the lines staring with > has to be added. Untested but should work
create a new variable
>local cacheCountForAttribute_caches={}
when the cacheCountForAttribute is initialised / increased use the lines below after them

>cacheCountForAttribute_caches[arrayIndex] = 0

>TableInsert(cacheCountForAttribute_caches[arrayIndex],cacheIndex)


and before the the for attrNum, count in Pairs(includedAttributes) do loop
>local uniq_caches={}

and in the end of the for a
>for _,index in IPair(cacheCountForAttribute_caches[attrNum]) do
>      uniq_caches[index]=index
>end

and final a loop to count the number of caches

>local nr_caches=0
>for _,i in Pairs(uniq_caches) do
>    nr_caches=nr_caches+1
>end
Thanks for the demonstration.  I'll see what I can do to update the script.  It will need a parameter, because it shouldn't change the behaviour for existing tags.
0 votes
Your description here, and on the cache page is a little unclear.  Which of these is correct?

1)  You must find 25 total caches.  Each of those must have either the swimming attribute or the wading attribute.

2) You must find 25 total caches.  Each of those must have both the swimming attribute and the wading attribute.

3) You must find 50 total caches.  25 of them must have the swimming attribute and 25 must have the wading attribute.

Also, the link you provided above to the cache page actually takes me to a different cache page.
by GentlePurpleRain (1.4k points)
You must find 25 caches in all.
You can use the attribute swimming and wading.
The cache you have found can either have swimming or wading.
Ex: 9 swimming and 16 wading

Sorry for not making it more clear in the first post.
...