Setting priorities work out. You should set the browser you are using to High and the bot to Realtime. If realtime isn't available, then just set it to High.
Always make your bot that you use higher than Runescape.
Open task manager and click the appropriate processes tab. Find the browser which would be whatever you are using (example Firefox is firefox.exe, chrome is chrome.exe)" would be runescape and anything with java would be the bot.
Right click on the browser process and set it to High.
Right click on the bot process and set it to realtime. If realtime isn't there, then set it to High.
It should help out a bit. (It worked for me at least)
I believe the biggest issue is how much CPU your pc will give off. At least in the pass for me Java uses a huge amount of CPU. You have to let java take all the power when its on and it does make a huge lag with a high CPU percentage.