Great tutorial! For those getting the "py_module = nullptr" error, here's a quick tip:
The module name varies between servers. Instead of hardcoding it, you could add a simple loop to auto-detect it:
```cpp
const char* possible_names[] = {"player", "playerm2g2", "rGuOnaAeJR", nullptr};
PyObject* py_module = nullptr;
for(int i = 0; possible_names[i] != nullptr; i++) {
py_module = PyImport_ImportModule(possible_names[i]);
if(py_module != nullptr) {
std::cout << "Found module: " << possible_names[i] << std::endl;
break;
}
}
```
This way your code works across different servers without manual changes.
Also, for those experiencing crashes: the threading issue mentioned by martinx1 is real. Consider using a hook on the main game loop instead of creating your own thread - much more stable!
PS: If you're just starting out with Metin2 reversing, this is honestly one of the cleanest beginner tutorials I've seen. Props to .back!