Thanks to KnightElite from the Technical Factorio Discord for the base script
