I have several instances of a struct(assoc array) that I want to pass to a function, which shall use its values in a call to ImageSearch function. Can you please help me defining the right syntax for that?
Here is not working code:
Code: Select all
global gBonusBttn := {x:0,y:0,X1:1670,Y1:0295,X2:1820,Y2:0450,dev:40,img:"red_new.png"}
global gSystemBttn:= {x:0,y:0,X1:1640,Y1:0820,X2:1810,Y2:1010,dev:40,img:"system_bttn.png"}
if(PeekObject(gSystemBttn))
MsgBox Success!!!!
Else
MsgBox Error!!!!
PeekObject(obj)
{
CoordMode, Pixel, Window
; that line below works, i want to replace it with my "obj" parameters
ImageSearch, x, y, 1395, 684, 1835, 1037, *40 F:\bot\Screen_20210518225507.png
ImageSearch, obj.x, obj.y, obj.X1, obj.Y1, obj.X2, obj.Y2, *obj.dev obj.img ; THAT LINE DOES NOT WORK...
return (ErrorLevel = 0)
}