Aha oke well next time please tell how much experienced you are with your bot cause I tought you already had a bot working but that you wanted to add auto potion to it:P
Oke well you said that you don't want to recreate the wheel so you're using srproxy well that's fine but it isn't wrong to take a look how that wheel works

cause you might have an idea of how it works but it might be the wrong idea. But that would be something for later
Uuhm back to your actual question.
You didn't mention the programming language which you're using cause there are a few differences between the language on how to implement your logic it doesn't matter right now but you might mention it the next time.
Oke so i'll tell you a little bit about my experience and how I started to create things. I guess that the most logical piece of software i've written is an simple emulator for silkroad so I'll tell you a bit how I builded that one (It's the same purpose as a bot you just respond to packets)
Well i just started with an packet parser to read the packets and I created some functions which sends an response to that specific packet. But when you're ingame you have a lot of stuff where you have to think about and create async functions which you also have to abort some times. The first attempt to create such things were really bad it worked but really bad the code was really really messy but I got something which worked.
Then I started to look at the code cause now I know what I exactly needed to manage a few ingame functions. So I wrote down what data I needed and with what kind of things I had to deal with. this way I got a better view of my program and how it actually worked. Then I started to split some things which could be separte parts so I devided the code a bit to make it more like modules instead of one big messy piece.
This way the code visiblity was much better and it was also easier to track down errors.
Also a nice advantage of those "separte modules" was that I could simply replace a piece of code with something which works a lot better without searching trough the whole messy thing. Of course the code still isn't good but it works and it's a lot better than it was before.
I really like this way cause you can apply all the experience which you gained to make the code better and more stable. The first attempt was really bad cause I did some error checking but it was more like "print "Error couldn't find item" well god knows in which function it was or what item. Right now if i print something i write something like "Foo() plus value out of range of item: item name of character: character name"
That makes things a lot easier to find problems.
So now you know a way of how I did it. But I would also like to think a little bit about your problem. I have never wrote a bot to don't rely on my solution
If I would create a bot the first thing I would do to log everything which happens ingame so reading the packets. Like what is the current hp/mp what player/mobs/npc's are arround me or did any of the npc's which I see right now despawn. Just all the stuff which you can also see ingame. This way you only have to respond on an incoming packet so you don't need a real bot logic yet but I guess once you have those things correct that the goal of creating a bot is a lot closer
After that I would start with things like select an object like an npc and open up the buy panel and buy something. just really simple things to make them work like walk to an monster, select monster, use skill. and at the same time you need to keep in mind that you still get packets of attack stuff which contains the damage you did and the amount of hp you've got left. so you can put a little trigger on that packet like:
if(CurrentHP < 500)
UseHpPotion();
So this way it checks if the hp is low and it sends a packet to the server that you used an potion and the server will give you the correct respond back and you update the bot with the message that the hp is updated and the client will also see that it's updated.
It sounds really easy the way I just said it but it's a lot more difficult than this and you have to keep a lot of things in mind but I hope this helps a little bit
btw sorry for some spelling mistakes ect.