I'm not an expert, but making such an agent is definitely possible. Packets with the necessary information exist and are used in PvE bots for fights already.
A PVP bot would just have to additionally prioritize players and determine whether they are viable targets, using the pvp-flag (and changes to it) in the

:
Code:
1 byte FreePVP //0 = None, 1 = Red, 2 = Gray, 3 = Blue, 4 = White, 5 = Gold
After that, it would just be a matter of the two opponents signaling combat readiness to each other (e.g. exchanging private messages to start or stop)
fighting to figure out the opponent's max HP, then prioritize the best skills to deplete it.
All of that aside, it would take a while to do that from scratch. You could look for bots and frameworks that work and add the pvp functions to them.
For example
- The fundamentals for networking:

Here's
of using the security for logging in
- Tutorials about development:
The newer one based on rewriting sro code: 
The old, in depth one: 
- Information to write your own handlers:
Here are two implementation examples:
, 