I have an issue with passing function with parameters in another function as parameter. Code below:
MSG(text) {
MsgBox, %text%
return
}
clicker(X1,Y1,X2,Y2,IMGFILE,ErrorLvlTrue,ErrorLvlFalse) {
CoordMode, Mouse, Window
CoordMode, Pixel, Window
sleep 1000
ImageSearch,OutX1,OutY1,%X1%,%Y1%,%X2%,%Y2%,%IMGFILE%
if (ErrorLevel = 0) {
return ErrorLvlTrue
}
else {
return ErrorLvlFalse
}
}
clicker(0,0,1900,1000,"*20 image_file.bmp",MSG(OutX1),MSG(OutY1))
I just got MSG() function call no matter if it found an image or not.