Scripting: get_score() after do_sidechain_snap() frequently returns previous score
|Opened on:||Tuesday, May 31, 2011 - 04:16|
|Last modified:||Tuesday, May 31, 2011 - 14:37|
I've written a script for examining multiple mutations and sidechain positions for Puzzle 425. The innermost loop of the script repeatedly snaps sidechains into their various positions and then immediately checks the resulting score.
Quite often, it appears that the sidechain snap instruction has not been completed by the time the score is checked. The score in the game window changes, but the score returned to my script (which I've written to the output window to verify) is the same as the score before the sidechain snap. It's definitely not an issue of snapping to the current position. The score is sometimes an improvement (those are the ones I notice, because my script is trying to find those (!) and misses them when this occurs).
Is this possibly a multiple thread issue? I'm fairly new to LUA scripting, so I don't know if there are ways to ensure that one instruction has been completed before the next is executed.
I'd be happy to provide further information if you can tell me what would be most helpful to you.
My apologies if this issue has been raised before. I didn't find anything similar in my search of the feedback database.