Yup! It's actually not too complicated, it's all the conditionals which make the script that long. The key thing to the script is the adjacency mask, which has the format //gmask ~[X][min][max], where X is an arbitrary mask (any mask syntax is valid) selecting which adjacent blocks to check, min...