click is done as a controlclick command and several keys are done as a controlsend or postmessage command because two windows to be run is the same program. and activated window is Program Manager(Title name of wallpaper(?) of computer)
In this situation, Neither of them works or only one of them works.
this is simplified script that i made ( title name of winodow is 1, and 2. coordinate of 1 is (0,0) and 2 is (1025,0) )
What do i do to drive well?
Code: Select all
setbatchlines, -1
f1::
coordmode, mouse,screen
coordmode,pixel,screen
settimer, a, 1000
settimer, b, 1000
a:
imagesearch,vx,vy,0,0,1030,697, C:\Users\me\Desktop\image.bmp
postmessage,0x100,96,5373953,,1
sleep,50
controlclick, X%vx% Y%vy%, 1,,L,1
sleep,50
postmessage,0x100,13,1835009,,1
sleep,50
postmessage,0x100,102,5046273,,1
sleep,50
postmessage,0x100,13,1835009,,1
sleep,300
return
b:
imagesearch,vvx,vvy,1025,0,1900,697, C:\Users\경택\Desktop\ㅉ.bmp
xx := vvx - 1025
yy := vvy - 0
postmessage,0x100,96,5373953,,2
sleep,50
controlclick, X%xx% Y%yy%, 2,,L,1
sleep,50
postmessage,0x100,13,1835009,,2
sleep,50
postmessage,0x100,102,5046273,,2
sleep,50
postmessage,0x100,13,1835009,,2
sleep,300
return
f2::
settimer, a, off
settimer, b, off
return