Цитата(shrewdo @ 28.10.2021, 18:32)
show your code to see and understand it first then maybe can help, you want to bind the click to a specific window?
I will try to explain in detail:
I have 4 windows of a game running uopilot code that basically just uses keyboard functions. With the exception of the time when it is necessary to talk to an NPC by clicking on him and when for some reason the character is disconnected and needs to enter a PIN code to access the character again.
Then my problem comes up, because sometimes 3 game windows need to use the mouse either to talk to the NPC or enter the PIN, that's when the macro gets out of control and sometimes starts clicking in the wrong places, opening windows in the game, walking with the character in a direction that he shouldn't be walking, finally I believe it has become clear...
I thought the only way to solve this would be a function that would make each tab of the 4 macros know when the mouse is occupied in one of the other tabs and give a wait until the mouse is released by the other macro tab, maybe there could be another solution, but it was the only one I could think of. If this is the only option, the question is... is this possible? How would I do this? I needed a light at the end of this tunnel... lol
PS: I reinforce once again that the same code is running in 4 UOpilot tabs, each linked to a different window.
PIN execution code by clicks:
Код
//1 PIN
:iniciopin
set $a findimage (0, 0 1920,1080 (imgs\0.bmp) %arr 2)
wait 1s
if $a > 90
move_smooth %arr[1 1] %arr[1 2]
wait 2s
left [1 1]
wait 2s
move_smooth 407, 369
end_if
//2 PIN
set $a findimage (0, 0 1920,1080 (imgs\0.bmp) %arr 2)
wait 1s
if $a > 90
move_smooth %arr[1 1] %arr[1 2]
wait 2s
left [1 1]
wait 2s
move_smooth 407, 369
end_if
//3PIN
set $a findimage (0, 0 1920,1080 (imgs\9.bmp) %arr 2)
wait 1s
if $a > 90
move_smooth %arr[1 1] %arr[1 2]
wait 2s
left [1 1]
wait 2s
move_smooth 407, 369
end_if
//4 PIN
set $a findimage (0, 0 1920,1080 (imgs\3.bmp) %arr 2)
wait 1s
if $a > 90
move_smooth %arr[1 1] %arr[1 2]
wait 2s
left [1 1]
wait 1s
move_smooth 407, 369
end_if
Execution code to talk to NPC:
Код
//Click NPC to open talk window
set $npc 467, 478
:npcopen
kright $npc
wait 1s
kright $npc