Hello all,
I would like to have a script for continuos image search on specific part of the screen + enter founded image as a text in opened text editor. When previous image is no longer displayed script should clear the line and search again. I have all images on my pc named image01.png, image02.png... Script could convert them into text just like they are named.
I have zero experience with programing so I really need a starting point for this.
Thank you guys!
Find image and enter it as a text in notepad.
-
- Posts: 3
- Joined: 11 Jan 2019, 18:23
-
- Posts: 3
- Joined: 11 Jan 2019, 18:23
Re: Find image and enter it as a text in notepad.
My apologies supplydrop, your reply was queued for moderator approval. Giving a bump now.
Re: Find image and enter it as a text in notepad.
Well, I can't really follow your description, but try first making a simple ImageSearch and see if it works.
Then we can proceed.
I commented out the Loop, but if you want to loop it, just remove the ;
I think a good idea would be that you create an Array of your images.
Like:
imageArray := ["image1", "image2"]
and instead of a simple loop, you'll use a for loop for the imagesearch and search for the current image.
That's only beta.
And don't forget to add the full path to the images if needed (inside of imagesearch).
Good luck
Then we can proceed.
Code: Select all
;Loop
;{
ImageSearch, x, y, 0, 0, 1920, 1080, *100 image1.png
if ErrorLevel = 0
{
MsgBox, Image1 has been found.
Sleep, 200
}
;}
return
I think a good idea would be that you create an Array of your images.
Like:
imageArray := ["image1", "image2"]
and instead of a simple loop, you'll use a for loop for the imagesearch and search for the current image.
Code: Select all
for i in imageArray
{
image := imageArray[i] ; Access array elements
ImageSearch, x, y, 0, 0, 1920, 1080, *100 %image%.png
if ErrorLevel = 0
{
MsgBox, %image% has been found.
Sleep, 200
}
}
And don't forget to add the full path to the images if needed (inside of imagesearch).
Good luck
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
-
- Posts: 3
- Joined: 11 Jan 2019, 18:23
Re: Find image and enter it as a text in notepad.
I probably mislead you with my description. I need Predefined images recognition on screen -> Conversion into text -> Copying to clipboard script.
Something like:
Value 'image1.png' = text 'image1'
Value 'image2.png' = text 'image2'
...
F1 to start a search on (x, y, w, h).
If 'image1.png' found, copy/paste text 'image1' to (x, y).
If not, search for 'image2'.
...
After X founded images, break.
F2 to clear pasted text on (x, y) and start a script from the beginning.
Less than 100 locally stored, predefined images in total. Is it possible to write something like that for a newbie?
Something like:
Value 'image1.png' = text 'image1'
Value 'image2.png' = text 'image2'
...
F1 to start a search on (x, y, w, h).
If 'image1.png' found, copy/paste text 'image1' to (x, y).
If not, search for 'image2'.
...
After X founded images, break.
F2 to clear pasted text on (x, y) and start a script from the beginning.
Less than 100 locally stored, predefined images in total. Is it possible to write something like that for a newbie?
Who is online
Users browsing this forum: No registered users and 375 guests