image found doesn't work on the second computer
Posted: 29 Mar 2018, 02:00
Hello
Can anybody explain what wrong with my macro. It works, but when I moved it on the second computer something was wrong. Computers are the same, the same monitors too, resolutions, os etc.
Screen_20180328221259.png contains a rectangle with letter e only, to work we have to do second printscreen with letter e, nothing else.
But why it doesn't work without it?
Can anybody explain what wrong with my macro. It works, but when I moved it on the second computer something was wrong. Computers are the same, the same monitors too, resolutions, os etc.
Screen_20180328221259.png contains a rectangle with letter e only, to work we have to do second printscreen with letter e, nothing else.
But why it doesn't work without it?
Code: Select all
[PMC Code v5.0.5]|F3||1|Window,2,Fast,0,1,Input,-1,-1,1|1|Macro1
Groups=Start:1
1|WinActivate||1|333|WinActivate||ahk_class Notepad|||
2|WinMove|50, 50, 800, 600|1|333|WinMove||ahk_class Notepad|||
3|[Pause]||1|500|Sleep|||||
4|Left Move & Click|10, 60 Left, Down|1|0|Click|||||
5|[Pause]||1|202|Sleep|||||
6|Left Move & Click|10, 60 Left, Up|1|0|Click|||||
7|[Pause]||1|250|Sleep|||||
8|t|{t}|1|0|Send|||||
9|[Pause]||1|150|Sleep|||||
10|e|{e}|1|0|Send|||||
11|[Pause]||1|150|Sleep|||||
12|s|{s}|1|0|Send|||||
13|[Pause]||1|150|Sleep|||||
14|t|{t}|1|0|Send|||||
15|WinMove|300, 150, 800, 600|1|333|WinMove||ahk_class Notepad|||
16|Continue, Continue, FoundX, FoundY, 0|3, 46, 52, 72, D:\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180328221259.png|1|0|ImageSearch|UntilFound|Window|||
17|If Image/Pixel Found||1|0|If_Statement|||||
18|[MsgBox]|image found|1|0|MsgBox|0||||
19|[Goto]|stop|1|0|Goto|||||
20|[End If]|EndIf|1|0|If_Statement|||||
21|[MsgBox]|image not found|1|0|MsgBox|0||||
22|[Label]|stop|1|0|Label|||||
Code: Select all
WinActivate, ahk_class Notepad
Sleep, 333
WinMove, ahk_class Notepad,, 50, 50, 800, 600
Sleep, 333
Sleep, 500
Click, 10, 60 Left, Down
Sleep, 202
Click, 10, 60 Left, Up
Sleep, 250
Send, {t}
Sleep, 150
Send, {e}
Sleep, 150
Send, {s}
Sleep, 150
Send, {t}
WinMove, ahk_class Notepad,, 300, 150, 800, 600
Sleep, 333
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 3, 46, 52, 72, D:\MacroCreatorPortable\x64\MacroCreator\Screenshots\Screen_20180328215723.png
}
Until ErrorLevel = 0
If ErrorLevel = 0
{
MsgBox, 0, , image found
Goto, stop
}
MsgBox, 0, , image not found
stop: