PokeTronic... I suggest you do not rely on it.
Anyway, I'll make a basic script for your Lugia wild battle, all you need to do is compile it in XSE. To do that, you'll need some basic knowledge which can be found in the Documents and Tutorials section.
You are using Rirered, right?
Now, open up A-Map and go to Lugia's offset. Change it to $800000. Open it in XSE in that offset, then compile the script I wrote you. Good luck!