d0sboots / PerfectTower

AI Scripts and Utilities for Perfect Tower II
Apache License 2.0
36 stars 11 forks source link

D0S.Factory - Active crafting prevents scripted window opening of Factory window. #12

Closed NickGrease closed 1 year ago

NickGrease commented 1 year ago

If D0S.Factory is actively crafting and the Factory window is closed, another script that attempts to open the factory window will fail to do so. I've tried to use my limited knowledge to work around this to no avail. I have a feeling it may be a technical limitation, but thought I'd report it all the same.

d0sboots commented 1 year ago

Sorry for the late reply.

This works fine for me. Here's my test script:

BFRlc3QBAAAABWtleS5iAAAAAAEAAAAQdG93bi53aW5kb3cuc2hvdwhjb25zdGFudAQHZmFjdG9yeQhjb25zdGFudAEB

If I leave the factory while it's crafting and then hit "b", I return to the factory. Note that you have to wait until the screen-switching animation finishes playing, you can't switch screens until then.

NickGrease commented 1 year ago

Thanks for your reply. It was indeed the screen switching, even though I included waits before and after window open/closes, it appears that closing my mine window caused a stutter in the window animation occasionally, and that stutter was just long enough that the call to open the factory window happened while the mine window was still closing. Slightly longer waits solved the issue.