ImageSearch Click Within A Box

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nwmv
Posts: 3
Joined: 19 Aug 2017, 12:44

ImageSearch Click Within A Box

19 Aug 2017, 12:56

Hi all :)

Looking for some help, here's what I currently have.

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 436, 192, 1520, 996, C:\Users\nwmv\Documents\image.png
If ErrorLevel = 0
MouseMove, %FoundX%, %FoundY%, 2
If ErrorLevel
Return
I'm trying to do a random click within a specific area of image.png once it's been found.
Image is 100x100 pixel, and the area I want to click between is 25, 25(x1,y1) and 75, 75(x2,y2)
Green is the whole image, red is the area I want to randomly click in. http://i.imgur.com/FtCQOG3.png
nwmv
Posts: 3
Joined: 19 Aug 2017, 12:44

Re: ImageSearch Click Within A Box

20 Aug 2017, 00:54

Found some help off of someone else's thread, but for some reason when I'm trying to use it in the game I want to use it for, it doesn't MoveMouse.
Even if I tab out and open the image with Windows Photo Viewer it doesn't work while the game is open.

Code: Select all

F1::
Random, ranX, 0, 25
Random, ranY, 0, 25
ImageSearch, FoundX, FoundY, 400, 400, 900, 900, C:\Users\nwmv\Documents\image.png
If ErrorLevel = 0
	MouseMove, FoundX+ranX, FoundY+ranY, 1
MouseClick, Left
If ErrorLevel
	Return
nwmv
Posts: 3
Joined: 19 Aug 2017, 12:44

Re: ImageSearch Click Within A Box

23 Aug 2017, 09:06

Can I get some help with this? I'm not sure why it won't MouseMove in game.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: inseption86, mikeyww and 444 guests