just had the idea of writing a quick guide to do what I found out
I'm finding out there's really not as much I can do
but about every time I look at the files I find something new about them
this is the unofficial guide
this is what you would find at https://api.elitemmonetwork.com/doku.php?id=eliteapi:functions:entity:setstatus
ELITEAPI_API bool __stdcall SetStatus(void* apiObject, int index, unsigned int status);
important parts: bool __stdcall, apiObject, int index, int status
bool tells you to use elite_api.SetStatus.restype = ctypes.c_bool
__stdcall tells you to use WinDLL in the line
elite_api = ctypes.WinDLL(r"D:\Downloads\EliteAPI.dll")
elite_api.GetPlayerIndex.restype = ctypes.c_int
elite_api.GetPlayerIndex.argtypes = [ctypes.c_void_p]
elite_api.SetStatus.restype = ctypes.c_bool
elite_api.SetStatus.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_uint]
loading a function from a dll using this method
the ctypes.whatever always needs to be added
this was the hardest part of me learning the correct code
but to find it you just look at the first line
ELITEAPI_API bool __stdcall SetStatus(void* apiObject, int index, unsigned int status);
which tells you that you need void int and unit right in the line
so it was all right there and pretty simple
apiObject is the pointer which tells you to use the line
instance_pointer = elite_api.CreateInstance(my_integer)
if you take a second to look at the code about it is
a name(instance_pointer in this case) = elite.api(the name of the dll) CreateInstance is the function to connect to a ffxi instance (my_integer) is a little complicated we use
selected_process_name = process_dropdown.get()
if selected_process_name in process_info:
pid = process_info[selected_process_name]
my_integer = int(f"{pid}")
this is a little complicated because it has more code to actually make the dropdown menu work
but what it is saying is selected process name = get and hold the process that you select
then hold the pid which is the process id now to use the process id you type {pid}
player_index = elite_api.GetPlayerIndex(api_object_ptr)
print(f"Player index: {player_index}")
this is a small part of code to find the player index about the same as above
it doesn't get used in the code below because I input the index manually
index_value = 1330
entity_status = 31
is manually setting the index value which you would find with the code above and a little more code
entity_status is also manually entered but the same every time always 31 if you want to clip
SetEntityStatus = elite_api.SetStatus(instance_pointer, index_value, entity_status)
result = SetEntityStatus
if result:
print("Entity status set successfully.")
else:
print("Failed to set entity status.")
while True:
SetEntityStatus = elite_api.SetStatus(instance_pointer, index_value, entity_status)
result = SetEntityStatus
if result:
print("Entity status set successfully.")
else:
print("Failed to set entity status.")
break
above is firing off the set status pointer which makes use of the instance pointer, index value, and entity status
all this is set right above
def clip():
# Attempt to load the DLL
elite_api = ctypes.WinDLL(r"D:\Downloads\EliteAPI.dll") # Replace "mydll.dll" with the actual DLL file name
elite_api.GetPlayerIndex.restype = ctypes.c_int
elite_api.GetPlayerIndex.argtypes = [ctypes.c_void_p]
elite_api.SetStatus.restype = ctypes.c_bool
elite_api.SetStatus.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_uint]
selected_process_name = process_dropdown.get()
if selected_process_name in process_info:
pid = process_info[selected_process_name]
my_integer = int(f"{pid}")
instance_pointer = elite_api.CreateInstance(my_integer)
api_object_ptr = ctypes.cast(instance_pointer, ctypes.c_void_p)
player_index = elite_api.GetPlayerIndex(api_object_ptr)
print(f"Player index: {player_index}")
index_value = 1330
entity_status = 31
SetEntityStatus = elite_api.SetStatus(instance_pointer, index_value, entity_status)
result = SetEntityStatus
if result:
print("Entity status set successfully.")
else:
print("Failed to set entity status.")
while True:
SetEntityStatus = elite_api.SetStatus(instance_pointer, index_value, entity_status)
result = SetEntityStatus
if result:
print("Entity status set successfully.")
else:
print("Failed to set entity status.")
break
and besides learning a little bit about tkinkter and a little bit about importing
this is basically it
now the code won't run on it's own but it only needs a few more sections of code
-upbeat
No comments:
Post a Comment