Posts: 2
Threads: 1
Joined: Jan 2024
Hello. i want to put a photo control along with a keyboard button.
in general the code I want to say:
press the Z button.
see if the photo disappeared, if not, press Z button.
I couldn't embed the wait -S inside the if...
Please help me
Posts: 12,073
Threads: 140
Joined: Dec 2002
With
wait -S use
err.
int w=win("" "MozillaWindowClass")
int timeout = 0
wait 2 -S "image:hC554A03F" w 0 16
err timeout = 1
if timeout
,out "did not disappear in 2 seconds"
else
,out "disappeared"
Or, if don't need to wait, use
scan instead of
wait -S. In the
Find image dialog select
Find and uncheck
Error if not found.
Posts: 2
Threads: 1
Joined: Jan 2024
02-15-2024, 10:04 AM
(This post was last modified: 02-15-2024, 10:20 AM by Pontios16.)
i need it to repeat the -S, and press the Z button and then the 5 button. once it sees that a photo is gone, then it goes further in the code.
Example
Rep
Wait -S "image..." w 0 16
Key z
Key 5
................
but when he sees that the photo is not there, to continue further.
i use scan in a similar way and it works perfectly
rep 9999999
if(scan("image:test[]image:test1[]image:test2[]image:test3[]image:chaos6boss4[]image:test5[]image:test6" w1 0 16))
break
else
key z
wait 2
key 1
key 2
....