Is there a possibility to use/adress GUI elements of the game client by python… for example if buying/selling of trade items by bot is prohibited by the server?
If they have a “confirm” dialog it is possible to send a mouse click on that window from Python. You need to access the win32 API using ctypes. This is why I added the
Allright, i think that implies, that i can send a mouse click on any position within the game client, right? Also client doen’t need to be in front with that method, right?
It depends. Sending mouse clicks to a window that is not visible can be kind of glitchy. You’d have to just try it.
Do you have a forum link or any other stuff for further reading on the get_client() function? Forum search didn’t result in anything usable…
You would need to use the win32 SendMessage/PostMessage APIs to send a mouse click to the “window” handle from get_client().
This could work but you need to convert it to Python.
I found a way to solve it by virtual mouse clicks, thank you!
but i`d like to open npc dialog with bot. I used this python script with the current Testing version:
still have problem with the “args” variable
[15:19:00] Python Error: name ‘args’ is not defined
[15:19:00] Script: Command not found [npc_select,Speciality Trader Jodaesan]
Your function needs to work like this:
def npc_select(args): return 0
So maybe I did not fully understand what the defined function does. I want to select npc and open/close the trader dialog so that it shows up in the client. Is this the right way to do it?Job NPC.txt (908 Bytes)
SCRIPT COMMAND used:
npc_select,Specialty Trader Jodaesan
npc_enter,Specialty Trader Jodaesan
At the moment bot doesn’t print any error but also doen’t open npc window.
Does this even work on private servers? (…inject_joymax(0x7045…)