I'm sorry if this is overdone, I don't come here often so I don't know. Basically I want to get better at playing by ear, I can play some simple riffs by ear, but when it comes to licks I just play around with it for an hour and only get one note right. So I was wondering what can I do to get better, besides the obvious thing which is just keep listening.
There is no faster way than listening if u want to learn things by ear. Also you must know all notes on your instrument (Guitar). Or you dont need to, but when you hear what you have to play, you know how the melody goes and you can hymn it inside your head. Try to hymn it with your guitar. Can't type this any more simple.
One thing I find that helps is closing my eyes when listening to a song because I scrap all visual links with what's being heard.

It's also a matter of persistence. Right now it might take you an hour to pick up something even simple, but that's okay, you'll get better the more you do it. Unfortunately there's no efficient way to do ear training (I've tried many times without success to find such a way of doing it). Some recommend knowing what different intervals sound like in comparison, but I find that only works well for chords, rather than lead riffs.
Quote by Okeefe Is Legit
Learning scales and finding the key a song is in will help a lot in terms of which notes could be played.

I usually do that and I hum along. It's not like I can't, it's just I want to know if, besides listening, there's a way to get better.
Quote by Freepower
Listen carefully to what you do and memorise the patterns, sounds and shapes. Learn the names for these sounds and shapes so the concepts are easy to organise.

As Freepower said, listen carefully to everything you play. Don't just play scales and patterns to train your hands, they will also help your ear if you pay attention to the sound.

Practice transcribing songs. Start out with simple melodies first.

Also, singing is one of the best forms of ear training. If you can play a note and then sing a major 3rd, or major 7th or some other interval from it, that will go a long way to helping you develop your ear.