Find image and enter it as a text in notepad.

Get help with using AutoHotkey and its commands and hotkeys
supplydrop
Posts: 2
Joined: 11 Jan 2019, 18:23

Find image and enter it as a text in notepad.

12 Jan 2019, 12:52

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!
User avatar
sinkfaze
Posts: 455
Joined: 01 Oct 2013, 08:01

Re: Find image and enter it as a text in notepad.

14 Jan 2019, 08:44

My apologies supplydrop, your reply was queued for moderator approval. Giving a bump now.
User avatar
Scr1pter
Posts: 764
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Find image and enter it as a text in notepad.

14 Jan 2019, 13:04

Well, I can't really follow your description, but try first making a simple ImageSearch and see if it works.
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 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.

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
   }
}
That's only beta.
And don't forget to add the full path to the images if needed (inside of imagesearch).

Good luck
I ignore every thread which contains the P-word :x
(Hint: It rhymes on Shython)
Please do not support cheaters!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 7 Pro 64 Bit - AHK version: 1.1.29.00

Return to “Ask For Help”

Who is online

Users browsing this forum: afe, AHKStudent, Google [Bot], Haasjes, jony26, Rohwedder, SOTE and 57 guests