There's nothing stopping you from using any language you like but if you want to have some resources to work from, you probably should choose C#, AS3 or Java.
AS3 is a terrible language and you generally want to avoid it. However, the official game client is made in AS3 so if you want to make hacks for a client, that is the way to go. I have an open source AS3 hacked client on my GitHub (SometimesRain/crazyclient; linking not allowed) that you could have a look at. AS3 is not magically the only language you can make the client with, it's just that making a new client from scratch would be a lot of work. If you choose to work with AS3, don't go and try learn AS3 exclusively. AS3, Java, C# and even Javascript are moderately similar languages so if you know one of them you should be able to work with all of them with moderate ease.
Java has been a popular language for a long time and resources to learn it are good. However most rotmg related Java resources are outdated. There's an open source Java proxy (AMPBEdu/Realm-Relay) for update 27.7.3 (2 years old) and a
proxy/bot bundle for 16.2 (4 years old). As you can imagine, the game has changed quite a bit and building on top of either of these would be quite difficult. @
Alde. is still working with Java and has his own private Java bots but that's not going to help you.
C# is a solid choice. It's useful as a general purpose language unlike AS3 and has up-to-date resources unlike Java. It's also the easiest to start making hacks with. K Relay (TheKronks/KRelay) has good documentation on how you can write your own plugins that modify the game packets. This is a good starting point to learning the packet structure of the game and the basics of programming if you don't know how to program yet. I myself started with writing hacks for Realm Relay, K Relay's predecessor and I can tell you it's not overwhelmingly difficult as one might think.
There are some other less popular options out there such as
C++ (toddw123/RotMG_Clientless; a C++ bot) and
Euphoria (
Spam bot and
auto ranking bot) but I would not recommend those. C++ is a known language and the internet sometimes makes it look like the only language that matters but it's not very beginner friendly and it generally takes more time to write functioning programs in C++. Euphoria on the other hand is a language you'll never hear mentined again after reading this post, so I wouldn't worry about it. The language has practically no future.
If you don't know how to program, you'll have to start by learning that first. After you've written some basic programs, you should get some open source K Relay plugins (TheKronks/KRelay,
Open source plugin pack #1 and
OS plugin pack #2) if you went the C# way and have a look at how they work. After, see if you can make your own plugin. A spammer plugin is a good starting point.
A good way to get into programming is to go on an online interactive course. An interactive course explains a programming concept and then makes you write a simple program using that concept. I learned to program on CodeAcademy's Javascript course for free but I've heard them having paid courses now. You might not find a course for C# but the basics are the same on most programming languages. You can surely find a Java course online. Learning basics of Java means that you've also learned basics of C#.