Image Search Help Topic is solved

Ask gaming related questions (AHK v1.1 and older)
HelloSir

Image Search Help

24 May 2015, 11:54

Dear Sir,

I am using this macro on an online game. In it actually monsters pop up randomly. I basically want to do the image search on popped window for desired image monster. I want it to stop clicking left as soon as image found. I don't know how to make this work. Basically dumb with image search rest thing is done by me in the pulovers macro creator software.

Please reply asap.

Thanks.
Guest

Re: Image Search Help  Topic is solved

28 May 2015, 10:51

hi :3

i would recommending doing pixelsearch instead as i find it faster and easier to use in making a game bot.
and also read his:
https://jszapp.com/autohotkey/2014/why- ... ode-tried/

imagesearch example:
SetWorkingDir, %A_ScriptDir%
#MaxThreadsPerHotkey 2
#SingleInstance Force
toggle = 0


Q::
Toggle := !Toggle
While Toggle
{
CoordMode, Pixel, Screen
ImageSearch, FoundX, FoundY, 0, 0, 1280, 1024, "picture.png"
If ErrorLevel = 0
Click, %FoundX%, %FoundY% Left, 1
}
User avatar
Chunjee
Posts: 1468
Joined: 18 Apr 2014, 19:05
Contact:

Re: Image Search Help

19 Jun 2015, 02:50

Pixelsearch is dumb. Can you link to the image you are using in your search? The way I would construct the script might look something like this:

Code: Select all

Busy = False
While !(Busy) { ;While Not busy with something else...
	ImageSearch, FoundLocX, FoundLocY, 0, 0, 1000, 1000, %A_ScriptDir%\PartialMonsterImage.png ;Search the screen for monster
	If !(ErrorLevel) {
		;Monster found! We are now busy with fighting it
		Busy = True
		
		Fn_FightMonster() ;This function will tell us how to fight the monster and make sure the fight ended
		
		;Finished; lets go back to looking for monsters...
		Busy = False
	}
}

Fn_FightMonster()
{
	;Do anything here when there is a monster	
	SendInput, 2
	SendInput, 3
	SendInput, s
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 29 guests