need help on advnaced ImageSearch

Ask gaming related questions
donggun612
Posts: 2
Joined: 29 Apr 2016, 13:24

need help on advnaced ImageSearch

29 Apr 2016, 13:38

Hello. my name is Don.

i'm trying to make a macro that do the auto fishing in Black desert mmorpg game.

fishing is the part of the mini game in this BDO. look at the image that i attached to that i can explain how it should work.

so basically it has to look at the words that pop up in the middle of the screen and type the letter keys.

i made it work with one screen image but the game screen is keep changing and the word image color change every different mini games.

so even though i use the imagesearch option with *number and *trans, it won't work well.

in the code, you can find what i'm tying to do in sub function called matching.

any advice or idea would be very helpful.

thanks all.



Code: Select all

Matching:
	MsgBox Good so far?.
	Loop 3
	{
		ImageSearch, BoxX, BoxY, 700, 450, 1200, 600, *90 *TransBlack C:\Users\DonYoo\Desktop\blackdesert\type2.PNG
		if (ErrorLevel = 0)
		{
			MsgBox Box %BoxX% %BoxY% find it.
			WordEndX := BoxX+100
			WordEndY := BoxY+80
			Loop 9
			{			
				ImageSearch, WordStartX, WordStartY, BoxX, BoxY, WordEndX, WordEndY, *100 *TransBlack C:\Users\DonYoo\Desktop\blackdesert\D.PNG
				if (ErrorLevel = 0)
				{
					MsgBox D %WordStartX% %WordStartY%
				}
				else
				{
					ImageSearch, WordStartX, WordStartY, BoxX, BoxY, WordEndX, WordEndY, *100 *TransBlack C:\Users\DonYoo\Desktop\blackdesert\E.PNG
					if (ErrorLevel = 0)
					{
						MsgBox E %WordStartX% %WordStartY%
					}
					else
					{
						ImageSearch, WordStartX, WordStartY, BoxX, BoxY, WordEndX, WordEndY, *100 *TransBlack C:\Users\DonYoo\Desktop\blackdesert\F.PNG
						if (ErrorLevel = 0)
						{
							MsgBox F %WordStartX% %WordStartY%
						}
						else
						{
							ImageSearch, WordStartX, WordStartY, BoxX, BoxY, WordEndX, WordEndY, *100 *TransBlack C:\Users\DonYoo\Desktop\blackdesert\S.PNG
							if (ErrorLevel = 0)
							{
								MsgBox S %WordStartX% %WordStartY%
							}
							else
							{
								MsgBox Out of loop
								break 2
							}
						}
					}
				}
				BoxX := WordStartX+16
				BoxY := WordStartY-5
				WordEndX := BoxX +  32
				WordEndY := BoxY + 20
				MsgBox NEXT %BoxX% %BoxY% %WordEndX% %WordEndY%
			}
		}
	}
Return

Attachments
2016-04-28_1244458134.JPG
2016-04-27_1171622909.JPG
Fish_All.ahk
(606 Bytes) Downloaded 64 times
User avatar
Flarebrass
Posts: 104
Joined: 20 Nov 2015, 13:13
Location: USA
Contact:

Re: need help on advnaced ImageSearch

02 May 2016, 07:11

I think the best idea would be to do a PixelSearch to find the general color of the arrow, then using the *transN feature to find similar pixel colors. The letters look difficult to grab, so I would begin by finding the direction that the arrow is pointing and press the appropriate key from there.
(Note that I can't test my code before posting, so beware of bugs! -Flarebrass Amatzikahni)
donggun612
Posts: 2
Joined: 29 Apr 2016, 13:24

Re: need help on advnaced ImageSearch

02 May 2016, 16:33

thanks for the advice. ! but the thing is arrow color changes as well.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 27 guests