Realize instances in geometry nodes simulatuon

I made a script. But it only works with object info node with instances checked on. Its also not the most efficient because it realizes the instance each frame. Instead of using a substitute object like a triangle. Anyway I used chatGPT to make so it is probably incredibly flawed but it works.
It only works with simulation nodes if you instance on points after the simulation.
So overall, it’s kind of limiting.

Here is the GPL free code on GitHub