Need help for my AHK Project

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kiko2max
Posts: 6
Joined: 15 Jun 2021, 13:31

Need help for my AHK Project

18 Jun 2021, 05:23

Good day,

I need help regarding about my AHKProject, I have a game that is running 1024x768 windows mode, what want to do is:

1. If the AHKProject detect/see/find a word "Keep Going" automatically send {Enter}
2. If the AHKProject detect/see/find "map1 123,456" "map2 12,34" "map3 123, 45" "map4 12,345" it will become:

for map1 a:=123 b:=456
for map2 a:=12 b:=34
for map3 a:=123 b:=45
for map4 a:=12 b:=345

Is there anyway I can do this? or is there any application or logical solution for this?

Thank you
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help for my AHK Project

18 Jun 2021, 06:14

You could have a look at ControlGetText and ControlSetText. Window Spy can show you the control names.
kiko2max
Posts: 6
Joined: 15 Jun 2021, 13:31

Re: Need help for my AHK Project

18 Jun 2021, 07:23

mikeyww wrote:
18 Jun 2021, 06:14
You could have a look at ControlGetText and ControlSetText. Window Spy can show you the control names.
I already solve the problem 1 which I use the findtext function.

the only problem left is problem 2.
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help for my AHK Project

18 Jun 2021, 09:13

Code: Select all

ttext =
For k, v in ["map1 123,456", "map2 12,34", "map3 123, 45", "map4 12,345"]
 arr := map(v), a := arr.1, b := arr.2, ttext .= "`na := " a ", b := " b
MsgBox, 64, Results, % SubStr(ttext, 2)

map(str) {
 RegExMatch(str, "(\d+), *?(\d+)", m)
 Return [m1, m2]
}
kiko2max
Posts: 6
Joined: 15 Jun 2021, 13:31

Re: Need help for my AHK Project

18 Jun 2021, 10:27

mikeyww wrote:
18 Jun 2021, 09:13

Code: Select all

ttext =
For k, v in ["map1 123,456", "map2 12,34", "map3 123, 45", "map4 12,345"]
 arr := map(v), a := arr.1, b := arr.2, ttext .= "`na := " a ", b := " b
MsgBox, 64, Results, % SubStr(ttext, 2)

map(str) {
 RegExMatch(str, "(\d+), *?(\d+)", m)
 Return [m1, m2]
}
I think I need to use OCR function. Do you have OCR function?
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help for my AHK Project

18 Jun 2021, 14:43

If you search the forum for OCR, you will find a few different flavors. One is below.

https://www.autohotkey.com/boards/viewtopic.php?t=36047

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5 and 210 guests