My friend recently bought the ACNL for the sole purpose of playing with me so the first thing she did was try to visit my town, but we have tried several times and the error code 018-0512 or 018-0511.We are really frustrated and disappointed because we have tried everything that was on other forums and also on the Nintendo site.We would appreciate any help.
I had this exact same problem too not long ago, when I was staying at my father's house. I never managed to find a solution, and what's strange is that it used to work just fine before I started getting errors. Now I'm at my mother's house and everything works fine, so I my guess is the problem is linked with the internet connection. There's an issue with either your or your friends connection so all you can do is either wait or use a different connection. :/
Go to the nintendo support chat and tell them what happened let them access your router settings and they do something there which allows your 3ds or something to access the wifi properly or something like that
That error code is unfortunately very common. I've gotten it myself. You can try to look up those error codes on the Nintendo support site, since it's worked for some people. They'll basically guide you through different solutions you can try like manually setting your 3DS's IP address or adding it to your router's DMZ zone.
Unfortunately, even if you do that, you can still have issues with it. I did all of that, and while it improved my problems somewhat, I still had that problem. After doing some research, I've found lots of people online reporting that they still got errors even after doing what Nintendo prescribed. You can try it and see if it works for you, and don't forget to update your game if you haven't yet (on the main menu when you start a game, there's an option like that on the list). Also, tell your friends to try that too.
However, if it doesn't work out for you, don't feel bad. It's seemingly very common.
I can visit some villages and be visited by their mayors, but I can't visit some villages and vice-versa. It can be complicated.