The packets have been encrypted since like 2006 to prevent sniffing and packet editing.
I'm not talking about a packet bot.
I've worked on anticheat in other games and working with raw packets is the easiest way to detect cheating.
The same would apply to botting in runescape: when inspecting an players sent packet data, patterns will emerge when a script is used. It would be difficult for humans to detect patterns from raw data, but that's what modern machine learning algorithms are for.
To prevent bans, all you would have to do is ensure that the packet output, that is generated by the bots actions, aka the API is close to a human to fool the machine learning tools jagex have built. I'm not talking about the structure of the sent packets or e.g mouse click packet data itself as that will obviously be the same, I'm talking about the metadata that you can infer from multiple packets e.g time between clicks, mouse movement, obvious timing patterns arising from the use of sleep in scripts.
tl;dr to not get banned, log packet outputs of both legit playing AND botting; figure out the differences between the outputs; change the APIs used and the script itself so that when botting, the packet dump is indistinguishable from legit playing