Is it possible to make image search and match to press a key but with 15ish different keys
Is it possible to make image search and match to press a key but with 15ish different keys
Is it possible to make image search and match to press a key but with 15ish different keys like a loop
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Yes. Put all 15ish keys in an array and cycle through them each time the image is found.
Re: Is it possible to make image search and match to press a key but with 15ish different keys
With 15 images and 15 keys/keystrokes
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Do you mean a different key for each image or 15 keys for each image?
Projects:
AHK-ToolKit
AHK-ToolKit
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Like this
Image 1 = key 1
Image 2 = key 2
And so on
But with a small scan area
Kinda like if this shows up then press this key
Now I will say I'm completely new to this and do not understand fully what this program Is capable of
Image 1 = key 1
Image 2 = key 2
And so on
But with a small scan area
Kinda like if this shows up then press this key
Now I will say I'm completely new to this and do not understand fully what this program Is capable of
Re: Is it possible to make image search and match to press a key but with 15ish different keys
yes, it's completely possible.
if you know how to use imagesearch you could do something like this:
you can then modify the keys variable easily.
edit:
change x1, x2, y1, y2 in imagesearch to match the region you're searching.
please note that if you're going to search different regions then you must make some changes to the loop
if you know how to use imagesearch you could do something like this:
Code: Select all
keys = a|c|e|b|k
loop parse, keys, |
{
ImageSearch, OutX, OutY, X1, Y1, X2, Y2, Image%a_index% ;save the images you're looking for, all with the same name but a sequence number at the end for this example to work
if errorlevel
send %a_loopfield%
}
edit:
change x1, x2, y1, y2 in imagesearch to match the region you're searching.
please note that if you're going to search different regions then you must make some changes to the loop
Projects:
AHK-ToolKit
AHK-ToolKit
Re: Is it possible to make image search and match to press a key but with 15ish different keys
So if I'm understanding correctly
This does it in a sequence but
I need it to be able to do
Image 1=key 1
Image 10=key 10
Image 9=Key 9
Can that be done
How do you know what to put in x1 x2 y1 y2
This does it in a sequence but
I need it to be able to do
Image 1=key 1
Image 10=key 10
Image 9=Key 9
Can that be done
How do you know what to put in x1 x2 y1 y2
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Do you have any control as to how to name the image files?
Regarding the region, you might want to use a script to get the x,y points of the places you want to search...
I will give you more info later on, as right now I'm on mobile.
Regarding the region, you might want to use a script to get the x,y points of the places you want to search...
I will give you more info later on, as right now I'm on mobile.
Projects:
AHK-ToolKit
AHK-ToolKit
Re: Is it possible to make image search and match to press a key but with 15ish different keys
I was thinking just doing a screenshot and rename it
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Code: Select all
keys = a|c|e|b|k
loop parse, keys, |
{
ImageSearch, OutX, OutY, X1=952, Y1=1150, X2=1089, Y2=1268, Image%a_index% ;save the images you're looking for, all with the same name but a sequence number at the end for this example to work
if errorlevel
send %a_loopfield%
}
okay so i have the cords but did i do it right ?
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Remove the "X1=", etc. like below. Also, The images should have a file extension, so you would add that as shown.
If you wanted to make it easier to match up the images to their letters, you could name them Image_a.png, Image_c.png, etc., and change the ImageSearch line to this:
Code: Select all
ImageSearch, OutX, OutY, 952, 1150, 1089, 1268, Image%a_index%.png
Code: Select all
ImageSearch, OutX, OutY, 952, 1150, 1089, 1268, Image_%A_LoopField%.png
Re: Is it possible to make image search and match to press a key but with 15ish different keys
i've done now but i have a folder which have all the images named 1,2,3,4,5,6,7,8,9,0,+ but how do i make it so if 6(image) shows up it presses 6(keypress) until it shows a new image
so it would spam it but controllable and be able to toggle it on and off
is it even possible
so it would spam it but controllable and be able to toggle it on and off
is it even possible
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Yes, it's very possible. I can describe the logic to you so you can write it. If you're not looking to learn how to write it yourself, perhaps someone will be willing to write it for you.
Re: Is it possible to make image search and match to press a key but with 15ish different keys
i am very interested in learning this but i only "started" yesterday so newbie would be an understatement
Re: Is it possible to make image search and match to press a key but with 15ish different keys
OK. Try this. It uses the F1 key to set the toggle, which is set to ON to start. (untested)
Code: Select all
keys := "1|2|3|4|5|6|7|8|9|0"
toggle := 1
loop
{
loop, Parse, keys, |
{
ImageSearch, OutX, OutY, 952, 1150, 1089, 1268, Image%a_index%.png
if !ErrorLevel ; image found
{
num := A_Index ; because A_Index will change in the next loop
key := A_LoopField
loop
{
if toggle
Send, % key
ImageSearch, OutX, OutY, 952, 1150, 1089, 1268, Image%num%.png
} until ErrorLevel ; image no longer found
}
}
}
return
F1::
toggle := !toggle
ToolTip, % "Toggle is " (toggle ? "ON" : "OFF")
SetTimer, ToolTipOff, -1500
return
ToolTipOff:
ToolTip
return
Re: Is it possible to make image search and match to press a key but with 15ish different keys
it is running and i see the tooltip ON and OFF but it does nothing besides that do i need to add a folder path for the images and maybe the names for them
Re: Is it possible to make image search and match to press a key but with 15ish different keys
The names of the images need to be Image1.png, Image2.png, etc. (the script is assuming that's how they are named) It currently expects them to be in the same directory as the script. If they're not, then you need to add either the relative path or the absolute path to the file name in both ImageSearch commands.
Re: Is it possible to make image search and match to press a key but with 15ish different keys
i moved the script to my folder with the images and renamed the images to Image5.png etc
changed the toggle button to F4
still nothing maybe i have the coords wrong or the images changes
does it assume to be run in sequence ? because i do not have a 1 and 2 for example
EDIT : i recropped 1 image and it WORKED XD
changed the toggle button to F4
still nothing maybe i have the coords wrong or the images changes
does it assume to be run in sequence ? because i do not have a 1 and 2 for example
EDIT : i recropped 1 image and it WORKED XD
Re: Is it possible to make image search and match to press a key but with 15ish different keys
now what can i do to have two images trigger the same key
this is exciting
this is exciting
Re: Is it possible to make image search and match to press a key but with 15ish different keys
Code: Select all
keys := "1|2|3|4|5|6|7|8|9|0|{Numpad0}|{Numpad1}|{Numpad2}|{Numpad3}|{Numpad4}|{Numpad5}|{Numpad6}|{Numpad7}|{Numpad8}|{Numpad9}"
toggle := 1
loop
{
loop, Parse, keys, |
{
ImageSearch, OutX, OutY, 940, 1130, 1100, 1270, Image%a_index%.png
if !ErrorLevel ; image found
{
num := A_Index ; because A_Index will change in the next loop
key := A_LoopField
loop
{
if toggle
Send, % key
ImageSearch, OutX, OutY, 940, 1130, 1100, 1270, Image%num%.png
if toggle
Send, % key
ImageSearch, OutX, OutY, 940, 1130, 1100, 1270, Image%numpad%.png
} until ErrorLevel ; image no longer found
}
}
}
return
F4::
toggle := !toggle
ToolTip, % "Toggle is " (toggle ? "ON" : "OFF")
SetTimer, ToolTipOff, -1500
return
ToolTipOff:
ToolTip
return
i've tried to make it so uses numpad too but i think i'm out of my league here