Would not recommend using this but if you really want to go ahead. The main reason is, it's a bit slow it managed a 49.4991% compression ratio It works! Finally, managed to make a compression script that works. It works by tokenizing the duplicates in the input. Version history; V0.1 created it, but doesn't fully work (it's pretty lossy) V1 it works, had to fix the text replacement script. V1.1Updated it and made it a ton faster (somehow) using a search width of 2 is best as it is the fastest and still get 60-80% compression ratio. V1.2 made it compress better by changing the way it encodes the text V1.3 made it faster by making the checking process stop once it finds a duplicate and move on to the next one quicker V1.3.1 added a check to make sure the script hasn't run out of tokens and to stop when it does. V1.3.2 added another check to speed it up. Backup of V1.3.2: https://scratch.mit.edu/projects/901419146/ V1.4 reworked the algorithm joining together the scanning and tokenizing process (making it better at compressing.) it now also tokenizes duplicate token patterns V1.4.1 added a check to make sure what it did actually helped. V1.4.2 made it jump back when compressing to find more duplicates.
Inspired by: https://scratch.mit.edu/projects/651469620/