Thanks a lot it works now even better than the old script because it's more exact so perfect!SteveMylo wrote: ↑21 Jul 2022, 19:23The answer is right there in front of you in my script.
The middle of the x coordinates is ((ok[1].x + ok[2].x) / 2).
So if you don't want a messy X value, then create a Variable. middleX := ((ok[1].x + ok[2].x) / 2)
*Also note that the X & Y in the below code if (ok:=FindText(X, Y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0, 0, Text)) is the position of the 1st image found. Which in this case you don't need.
** Also with the new FindTEXT function you have, you don't need this clutter ===> xx:=ok.1.1, yy:=ok.1.2, w:=ok.1.3, h:=ok.1.4Code: Select all
q:: MouseGetPos, xx, yy Text:="|<>*imgtext1----" Text.="|<>*imgtext2----" if (ok:=FindText(X, Y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0, 0, Text)) ; <== you can (Plus + or Minus -) anything from the search range as you know, e.g. (A_ScreenHeight /2) or (A_ScreenHeight - yy) etc etc. You get the gist obviously. ;~ ====> (pasted here just for reference) ====> MouseClick, Left, ((ok[1].x + ok[2].x) / 2), ((ok[1].y + ok[2].y ) / 2), 1, 1 middleX := ((ok[1].x + ok[2].x) / 2) { MouseMove, middleX, yy, 1 } return
Only thing strange for me about the Include function (as apposed to having all code in one script) is I am infact getting a noticable lagg on certain scripts. The one you provided was fast and nice, but on others I get a delay on for some reason. Is it faster if I put the findtext file in this lib folder somehow?