how does image search works
how does image search works
hey I'm pretty new to ahk and I'm trying to make a script where it recognizes a certain image and then presses a certain key when it finds the image. its for a game named graal era with a fishing job I'm trying to bot, when I'm fishing i press D to cast the line and when it the fish bites, it changes the baits image then ill have to press D again to catch it . so I'm trying to figure out how to make a script to recognize that image change and then press D to catch it . thanks in advance!
Re: how does image search works
Save an exact screenshot of the image that you want, in PNG format. Crop to the part that you want to find. You can then issue an ImageSearch command to find the image whenever needed. If you're lucky, your game will not block cheaters.
Re: how does image search works
hello, im trying to do the same thing as this person, ive got a whole script written out but imagesearch always triggers a false positive, I will explain.mikeyww wrote: ↑12 Apr 2021, 14:03Save an exact screenshot of the image that you want, in PNG format. Crop to the part that you want to find. You can then issue an ImageSearch command to find the image whenever needed. If you're lucky, your game will not block cheaters.
in order to successfully fish, a hook image must overlap a bobber image, the hook is going from left to right on a loop, and the bobber image appears after a couple seconds in a random spot, it always triggers the imagesearch positive when the bobber appears, I am using an image of the hook and bobber overlapped but like I said it always triggers a positive search when the bobber appears not when they overlap like I want it to. is there anything more i could do to strengthen my parameters?
might there be a better solution to what ive written already?
heres my code:
Code: Select all
f1:: ; fish skill
loop ; start:
send {j}
{
ImageSearch, OutputVarX, OutputVarY, 937, 512, 300, 300, 0, 0x055150 *w11 *h18 C:\Users\btcvi\Desktop\fish2.png
if (ErrorLevel = 0)
Send, {j down} sleep 2500 {j up}
Sleep 1300
}
f2::Pause ; pauser
Re: how does image search works
If your Loop applies to a block, then enclose the block in braces immediately below your Loop command.
Put your Sleep command on its own line. Separate commands are generally on separate lines.The loop command is usually followed by a block, which is a collection of statements that form the body of the loop. However, a loop with only a single statement does not require a block (an "if" and its "else" count as a single statement for this purpose).
Re: how does image search works
@graal - It would be better if you didn’t try to get the same advice in two different threads.
viewtopic.php?f=18&t=98648
viewtopic.php?f=18&t=98648
Who is online
Users browsing this forum: No registered users and 48 guests