#include <Windows.h>
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
void error(int errorid){
switch (errorid)
{
case 0:
cout << "Couldn't find window." << endl;
break;
case 1:
cout << "Couldn't open process." << endl;
default:
break;
}
exit(errorid);
}
int main(){
const char* name = "Ragnarok Online"; //window name
const DWORD address = 0x9B224C; //address food is stored in
HWND hwnd; //window handle
DWORD pid; //process id
HANDLE handle; //program starting address(?)
DWORD food; //used to store our pets current food value
cout << name << endl;
hwnd = FindWindow(NULL, name);
if (!hwnd)
error(0);
GetWindowThreadProcessId(hwnd, &pid);
handle = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if (!handle)
error(1);
while (true)
{
ReadProcessMemory(handle, (LPCVOID)address, &food, 4, NULL);
if (cin.peek())
{
string input;
cin >> input;
if (input == "food")
{
cout << "Pet's current food is: " << food << endl;
}
else
{
cout << "Unknown Command!";
}
}
}
return 0;
}

but..
? Depends on your needs, but if this is a personal project, maybe take the easy route for now, and learn about packet stuff later? I'm not sure either.