First things first:
I guess the "!! GetFile failed for ..." lines in $PATH_TO_MA\Prices\LHpi.tcgplayerPriceGuide.log were a dead giveaway on what went wrong there...
The canonical way (and the only change the above hotfix file contains) is to comment out the line, similar to how all other options that are also left for the library to set to default values, but yours is no less valid
- nitpick | Open
- actually, as you've kept the comment I made (specifically to remind myself to change it before I release it ) "download from dummy" is not a correct description after "OFFLINE=false"
As for the error (and crash) itself: thanks for pointing out a reliable way to reproduce it. This seems to be a MA bug. The last lines of the script that get executed are
- Code: Select all
LHpi.Log( "Lua script " .. scriptname .. " finished" ,0)
collectgarbage()--try prevent MA crashes on exit
ma.Log( "Lua script " .. scriptname .. " finished" )
end -- function ImportPrice
and since both $PATH_TO_MA\Prices\LHpi.tcgplayerPriceGuide.log and $PATH_TO_MA\Magic Album.log show those lines, I can only conclude that my script has indeed finished at the point of the crash. Fortunately, the problem is easily avoided.
For now, I would love you to use your newly gained insight into the scripts to check
http://www.slightlymagic.net/wiki/How-To_sitescriptTemplate for general understandability... Feel free to improve the page
I have not written an "updating sitescripts to new library/template version - 2.13 TO 2.15" section yet.
I will shortly update the other sitescripts (they already run with lib version 2.15.6 without errors) to include the update helper function site.FetchExpansionList(), and use it to update site.sets with all available sets. What I won't do this time is site.namereplace,site.foiltweak tables for the new sets and site.expected (which is read if CHECKEXPECTED is left at the default true and shown in the log if VERBOSE is set to true).
If you could just drop some hints on where how you collect data for replacement tables, I could help you with future releases.
You will probably need multiple runs of the script to determine everything, so to save time and bandwidth, I suggest the following preparation:
example with LHpi.tcgplayerPriceGuide.lua
- create a new $PATH_TO_MA\Prices\LHpi.tcgplayerPriceGuide\ directory
- edit LHpi.tcgplayerPriceGuide.lua to set SAVEHTML=true
- run the script to download all source html files
- edit LHpi.tcgplayerPriceGuide.lua to set OFFLINE=true (don't forget to change it back once you're done and want live data again)
Now for the namereplacement
- The target names can be found in lib\LHpi.Data-v5.lua (for cards that have variants) or in MA (Oracle name or localized name)
- To find the source names, set VERBOSE=true and LOGNAMEREPLACE=true (I'd set LOGDROPS,LOGFOILTWEAK,STRICTEXPECTED true as well),
- then run the script again and open the log
- find all lines that start with "! LHpi.SetPrice". those tell you exactly which cards failed to be set, including the name LHpi sent to MA. For tokens, suffix the name with " Token" to enable LHpi to detect the object type.
- If the site_name-to-LHpi_name mapping is not obvious, you can compare the card image on the site with the one in MA (prominent example: Basic Lands in sets without collector numbers).
- Run the script again and observe the new "namereplaced X to Y" lines in the log, then hopefully see how the number of failed cards has decreased, while the number of namerepalced cards has increased.
- repeat until either all cards from the source are identified or all cards in MA have received the correct price
- change site.expected to tell LHpi how many successfully set ("pset"), failed and namereplaced cards to expect.
EDIT: download links on wiki page changed to corrected version
EDIT2: if the above heuristic fails, you can either try to figure it out by looking at the other sets' namereplacement and variant tables, or report back to me and I will fix the rest.
EDIT3: best do the download run from MA. If you use the dummyMA in OFFLINE=false mode, you either need to provide luasockets yourself or wait until I get around documenting installation and license for the external dependencies.
EDIT4: The options described in the above steps are now much more sensible... please read the code comments to sanity check anything I say in this post
EDIT5: If you have cards that refuse to be namereplaced and your suspect that special characters are to blame, you can try writing them as "\ddd" (where ddd is the byte value, padded with leading zeros to three digits). Lua is character encoding agnistic, every string is just a string of bytes internally.
- set DEBUG=true
- The log is now very wordy, but you can search for (part of) the card name.
- At some point, there will be a byte-for-byte representation of the name in the log.
- This is the state of the card name manipulation directly before LHpi looks for a namereplace entry (which, in turn, happens before foiltweak, variant and object type detecion.)