Advanced

Trying to learn

Trying to learn
January 08, 2021 10:38PM
So, I've been thinking of learning to write challenge checker scripts for a variety of reasons.

I decided that I'd start with something that was already created, specifically the quadrangle script that is used for Delorme Challenge Checkers.

I copied the Virginia one exactly, and created a new script with the code. Even though the code is exactly the same, I get an error on mine seemingly indicating that there's a problem with the arguments. I get the following error.

Error Log
[string ""]:83: bad argument #1 to 'pairs' (table expected, got boolean)

Script Output
Array
(
)

Is there someone willing to get me past this basic initial hurdle, so that I can play around and see what's possible?

Thanks,

Jon
Re: Trying to learn
January 09, 2021 11:49AM
There are two ‘parts’ to a checker - the actual script, and the configuration. The script is the code, and the configuration is the input variables to check, so that a new script doesn’t need to be written for each individual checker. For example, there are two challenges, Find 100 caches, and Find 250 caches. They would likely both use the same script, but you would change the configuration to make it work for that cache.

I think what you have done, looking at your script and tag, you have copied the script for lillfiluren’s Generic Poly Checker, which is used for a lot of different polygon checkers, and havent used any configuration tag. If you use the following tag used in the original checker, it should be identical to the Virginia DeLorme Checker:

{
"polyset": "Delorme_VA",
"region": "Virginia",
"excludedtypes": [
"Events",
"Locationless (Reverse) Cache"
],
"ignorepolynamesuffix": "B"
}

Hope this helps!
Re: Trying to learn
January 09, 2021 04:09PM
That was it. I think I can start playing now. Sometimes, just getting beyond the initial basic concepts is the most difficult part. I totally ignored the "Tags" section, thinking that it was "Tags" similar to adding search tags. I understand that it is now essentially the initialization parameters.

Thanks for very much.
Re: Trying to learn
January 11, 2021 04:05AM
One thing to be aware of is that most of the configurations for that Generic Poly Checker script are too big for the tag size limit, so the actual polygons have been uploaded onto the server. "polyset": "Delorme_VA" refers to one such uploaded polygon set.

And, as DrAcorn said, most challenges can be done with tags on an existing script. Script writing is more for if you have an unusual set of conditions. Before writing a new script, it's good to try "Find scripts" and see if there's one you can tag.
Re: Trying to learn
January 11, 2021 11:24AM
Also keep in mind that polygon challenges are not allowed since April 21, 2015
Re: Trying to learn
January 11, 2021 07:57PM
Yup, I know.

It's a task that I've made for myself to learn this.

If there's a usage checker out of it, I might make an optional challenge.
Sorry, you do not have permission to post/reply in this forum.