Jump to content
×
×
  • Create New...
  • 0

Calling python api with C ?


ledi12

Question

Version of Files XXX

Hi,

I'm trying to call some api functions from player module, like character position.

 

PyObject* obj = PyImport_ImportModule(const char *"player");
std::cout << obj.GetMainCharacterPosition() << std::endl;

I would appreciate any hint to to call python api in C.

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1
  • Moderator

Is not that easy as you think and also you need to make individual code for each function, if they've arguments and more.

Here's my method, i tested it and works fine.

This is the hidden content, please

 

Edited by VegaS™
  • Metin2 Dev 1
  • Love 8
  • Good 3
Link to comment
Share on other sites

  • 0
On 7/9/2020 at 9:02 PM, VegaS™ said:

Is not that easy as you think and also you need to make individual code for each function, if they've arguments and more.

Here's my method, i tested it and works fine.

Looks fine to me :) To make it working I need to inject it as the dll first hmm ? 

Edited by VegaS™
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.