Hello.
I'm trying to make a simple FishingPlanet (Unity engine) bot, that [reads some basic data] -> [performs certain actions - mostly mouse clicks, based on that data] UNTIL -> [An ingame window opens containing info about catched fish]
(I'm an absolute beginner, just saying)
So, i managed to implement the second part (performing the actions) but atm i need to input the data (eg. behavior of the fishing rod model) manually in the code.
The problem is to find some way to get the data from the game. I tried to use Cheat Engine, to find a value which has different values based on if the rod is casted or not, or if the fish is catched, but couldn't find one any method. I tried searching for values/strings that are displayed ONLY when fish is catched, with no success (Either 0 values found or 200+ that doesn't seem to have anything in common with the window that is being displayed.
Do anyone have an idea how to get an address that could help me get this data from the game? Maybe i'm doing something wrong in the Cheat Engine / or i should use a different method? I also wanna add, that getting visual/image data is the last thing i wanna do, unless there is a really efficient way to do it.
//EDIT
I found an adress, now i need to read it, but when i read it using this code:
Code:
ReadProcessMemory(handle, (LPVOID*)0x23FB9971C64, &isCasted, sizeof(isCasted), 0);
it always returns "-858993460" value, when in cheat engine it stays at 0. The value is the same for every of like 10 addresses i tried.
Code:
int isCasted;
DWORD address = 0x23F938277C5;
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
if (procID = NULL) {
cout << " Cannot obtain the process." << endl;
Sleep(3000);
goto start;
}
else {
cout << "";
read:
//WriteProcessMemory(handle, (LPVOID)0xAEEA6C, &newValue, sizeof(newValue), 0);
ReadProcessMemory(handle, (LPCVOID)address, &isCasted, sizeof(isCasted), NULL);
cout << GetLastError() << endl;
cout << "address value: " + isCasted <<endl;
goto read;
Sleep(1000);
}
//EDIT
RPM works now.
Now, i realised that the address is dynamic, so everytime game is restarted the address changes. Any way arround it?