Code: Select all
~LButton::
if ((A_PriorHotkey <> "~LButton") or A_TimeSincePriorHotkey > 400)
FindText(X:="wait", Y:=0.4, X0-offset, Y0-offset, X0+offset, Y0+offset, 0.000001, 0.000001, Text,1,0)
Can it be changed to "Settimer" mode?
Code: Select all
~LButton::
if ((A_PriorHotkey <> "~LButton") or A_TimeSincePriorHotkey > 400)
FindText(X:="wait", Y:=0.4, X0-offset, Y0-offset, X0+offset, Y0+offset, 0.000001, 0.000001, Text,1,0)
Code: Select all
Text:="|<>*115$58.UQsD3kQ1kA0n0M60k30E3AH2Ml0A07AlwT74QnWQn0lwQFXCBnC17ll0CszAz4T741zXsngFYAF7w03A10M16A10QkC3kAMEC"
if (ok:=FindText(X, Y, 869-150000, 545-150000, 869+150000, 545+150000, 0, 0.000001, Text))
{
FindText().Click(X, Y, "R")
}
Code: Select all
FindText(X, Y, 869-150000, 545-150000, 869+150000, 545+150000, 0, 0.000001, "|<>*115$58.UQsD3kQ1kA0n0M60k30E3AH2Ml0A07AlwT74QnWQn0lwQFXCBnC17ll0CszAz4T741zXsngFYAF7w03A10M16A10QkC3kAMEC").Click(X, Y, "R")
Code: Select all
FindTextClick(869-150000, 545-150000, 869+150000, 545+150000, 0, 0.000001, Text)
FindTextClick(args*) {
if FindText(X, Y, args*) {
FindText().Click(X, Y, "L")
return 1
}
return 0
}
Code: Select all
WinGetPos, vX, vY, vW, vH, ahk_exe chrome.exe
FindTextClick(X, Y, vX, vY, vX+vW, vY+vH, 0.000001, 0, Text)
I don't understand what you mean by that. Return 0 cannot fail
The FindTextClick was just an example to give you an idea of what I meant, and should be customized for your specific needs. For example, FindTextClick(X, Y, vX, vY, vX+vW, vY+vH, 0.000001, 0, Text) won't work because FindTextClick will not return anything with the X and Y variables. So you would need to modify it to FindTextClick(vX, vY, vX+vW, vY+vH, 0.000001, 0, Text), or change the FindTextClick function to return X and Y as well:I know this may be a basic mistake, but let me know if you'd like to know.
Declaring vX, vY, vW, vH variables globally didn't work.
The following did not work.
Code: Select all
WinGetPos, vX, vY, vW, vH, ahk_exe chrome.exe FindTextClick(X, Y, vX, vY, vX+vW, vY+vH, 0.000001, 0, Text)
Code: Select all
WinGetPos, vX, vY, vW, vH, ahk_exe chrome.exe
FindTextClick(X, Y, vX, vY, vX+vW, vY+vH, 0.000001, 0, Text)
FindTextClick(ByRef X:="", ByRef Y:="", args*) {
if (ok := FindText(X, Y, args*))
FindText().Click(X, Y, "L")
return ok
}
Code: Select all
FindText(X:="wait", Y:=1, 0,0,0,0,0,0,Text)
Code: Select all
FindText(X,Y, 0,0,0,0,0,0,Text)
Code: Select all
FindText(X:="wait", Y:=1, 0,0,0,0,0,0,Text)
Code: Select all
if (ok := FindText(X,Y,0,0,0,0,0.000001,0.000001, Text,,1,["One","Two","Three"]))
{
MouseMove, ok[1][1]+15, ok[1][2]+5, 0
gosub GoSub_Klick
MouseMove, ok[2][1]+15, ok[2][2]+5, 0
gosub GoSub_Klick
}
Code: Select all
_o
_o
_o
Code: Select all
_oo_
_oo_
_oo_
_oo_
Code: Select all
if (ok := FindText(X,Y,0,0,0,0,0.000001,0.000001, Text,,1,["One","Two","Three"]))
{
MouseMove, ok[1][1]+15, ok[1][2]+5, 0
gosub GoSub_Klick
MouseMove, ok[2][1]+15, ok[2][2]+5, 0
gosub GoSub_Klick
}
Code: Select all
if (ok := FindText(X,Y,0,0,0,0,0.000001,0.000001, Text,,1,["Two","One","Three"]))
{
MouseMove, ok[1][1]+15, ok[1][2]+5, 0
gosub GoSub_Klick
MouseMove, ok[2][1]+15, ok[2][2]+5, 0
gosub GoSub_Klick
}
Code: Select all
if (ok := FindText(X,Y,0,0,0,0,0.000001,0.000001, Text,,1,["Three","One","Two"]))
{
MouseMove, ok[1][1]+15, ok[1][2]+5, 0
gosub GoSub_Klick
MouseMove, ok[2][1]+15, ok[2][2]+5, 0
gosub GoSub_Klick
}
Code: Select all
ok := FindText(X,Y,0,0,0,0,0.000001,0.000001, Text,,1,["Three","One","Two"]
for k, v in ok {
ToolTip, % "Found Text id: " v.id "`nX: " v.x " Y: " v.y
FindText().RangeTip(v[1], v[2], v[3], v[4])
Sleep, 2000
}
Code: Select all
characterset := "|<0>[b]50$6.SGHnnnHGSU|<1>[/b]50$3.D999A|<2>[b]50$6.SH336AMEzU|<3>[/b]50$6.SG22C33nSU|<4>[b]50$6.66CCKqz66U|<5>[/b]50$6.SEESH33mSU|<6>[b]50$6.CPEkynHHCU|<7>[/b]50$6.z12264A88U|<8>*205$6.SznSSnnnSU|<9>[b]50$6.SGnHT33KSU"
FindText().PicLib(characterset, 1)
searchPhrase := "101"
if (ok:=FindText(X, Y,1095, 1131,1620, 1388, 0, 0,FindText().PicN(searchPhrase)))
{
FindText().MouseTip(X, Y)
}
return
Thanks for the kind wordsBy the way I just wanted to thank you and appreciate the time put into writing this very detailed article. For a long time I found FindText to be impenetrable. I am actually using it now, thanks to you!
Ahh, perfect. For prosperity, I will go over this article again as soon as I can. Thanks allot Descolada.
Code: Select all
FindText().PicLib("|<[>*125$4.00N4F4F4FU2", 1) ;<=== In this example, only left bracket is present in library
TopX := 666
TopY := 5
BottomX := 1271
BottomY := 261
ok:=FindText(X, Y, TopX, TopY, BottomX, BottomY, 0, 0, FindText().PicN("["),,,1)
if (ocr := FindText().OCR(ok, 3, 3)){
MsgBox, % ocr.text
}
Users browsing this forum: No registered users and 35 guests