Advanced

Change History

Discuss your script development with others (bugs, optimizations, methods ...)

Message: GetAttributeList returns extra attributes?

Changed By: DrAcorn
Change Date: August 21, 2021 06:52PM

GetAttributeList returns extra attributes?
I was using the call PGC.GetAttributeList() with this section of code:
[code]
local a = PGC.GetAttributeList()
local attr = {}
attr['desc'] = {}
attr['icon'] = {}
for k,v in pairs(a) do
attr['desc'][k] = v.attributeName
attr['icon'][k] = v.imageSet
if (v.imageUnset) then
attr['desc'][k+96] = "NOT "..v.attributeName
attr['icon'][k+96] = v.imageUnset
end
end
PGC.print(a)
[/code]
However, lots of attributes now seem to return images for when they are unset, and so the output includes them too, even though they are impossible to get (I think). They include:
UV-no.png 'NOT UV light required' caches (0 combos)
snowshoes-no.png 'NOT May require snowshoes' caches (0 combos)
s-tool-no.png 'NOT Special tool required' caches (0 combos)
skiis-no.png 'NOT May require cross country skis' caches (0 combos)
geotour-no.png 'NOT GeoTour' caches (0 combos)
bonuscache-no.png 'NOT Bonus cache' caches (0 combos)
challengecache-no.png 'NOT Challenge cache' caches (0 combos)
powertrail-no.png 'NOT Power trail' caches (0 combos)
wirelessbeacon-no.png 'NOT Wireless beacon' caches (0 combos)

amongst others (ignore the combos part)
. It seems all positive attributes now have negative attribute images. You can see this if you run this checker with a cacher with high finds: https://project-gc.com/Challenges/GC9ET81/62461
I don't remember this happening last time I used it, perhaps there has been an update?

Original Message

Author: DrAcorn
Date: August 21, 2021 06:48PM

GetAttributeList returns extra attributes?
I was using the call PGC.GetAttributeList() with this section of code:
[code]
local a = PGC.GetAttributeList()
local attr = {}
attr['desc'] = {}
attr['icon'] = {}
for k,v in pairs(a) do
attr['desc'][k] = v.attributeName
attr['icon'][k] = v.imageSet
if (v.imageUnset) then
attr['desc'][k+96] = "NOT "..v.attributeName
attr['icon'][k+96] = v.imageUnset
end
end
PGC.print(a)
[/code]
However, lots of attributes now seem to return images for when they are unset, and so the output includes them too, even though they are impossible to get (I think). They include:
UV-no.png 'NOT UV light required' caches (0 combos)
snowshoes-no.png 'NOT May require snowshoes' caches (0 combos)
s-tool-no.png 'NOT Special tool required' caches (0 combos)
skiis-no.png 'NOT May require cross country skis' caches (0 combos)
geotour-no.png 'NOT GeoTour' caches (0 combos)
bonuscache-no.png 'NOT Bonus cache' caches (0 combos)
challengecache-no.png 'NOT Challenge cache' caches (0 combos)
powertrail-no.png 'NOT Power trail' caches (0 combos)
wirelessbeacon-no.png 'NOT Wireless beacon' caches (0 combos)

amongst others (ignore the combos part)
I don't remember this happening last time I used it, perhaps there has been an update?