With this I can know if an electrical network is connected to a factory, simply comparing the id from the transformers until they are all the same, resulting in all the factories connected to the same network. 8)
(https://www.mediafire.com/convkey/8bf1/8qd8vckgvppdipa6g.jpg)
I added some functionality to check this with r8960:
http://dwachs.github.io/simutrans-sqapi-doc/changelog.html
This is great. :D
I will solve the problem with my script, thank you very much!.