alainbryden / bitburner-scripts

My own scripts for playing bitburner
MIT License
607 stars 272 forks source link

helpers.js: tail helper, tailedPids cache isn't reset on augmentation #412

Closed alainbryden closed 1 week ago

alainbryden commented 3 weeks ago

We currently use a cache tailedPids for two purposes:

The problem is this "global memory" cache isn't reset when we install augmentations, so since most startup scripts will get low PIDs (1,2,3...), which are probably in the cache, they won't get properly resized or positioned.

We either need a way to clear the cache on reset, or find a different mechanic to keeping previously tailed windows stable. The original solution hashed the processId to produce a deterministic number, and used that number to pick one of a series of designated positions, but the random nature of this approach might lead to a poor distribution of tail windows.