Help with BitMap

Ask gaming related questions (AHK v1.1 and older)
zarioftw
Posts: 6
Joined: 18 Mar 2018, 08:37

Help with BitMap

18 Mar 2018, 08:46

My original goal was to make a certain bot like script. That would find the bitmap, and click on it. (bitmap and not pixel because i want it to be precise). The only problem with the script below is... it doesn't find the bitmap, and i'd like to know is this because the active window is a java client. Of course there can be many other reasons... An advanced thank you to any help given! :?


Code: Select all

f1::
ImageSearch, FoundX, FoundY, 40,40, 300, 300, C:\plo.bmp

CoordMode Pixel
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
if ErrorLevel = 2
    MsgBox Could not conduct the search.
else if ErrorLevel = 1
    MsgBox Icon could not be found on the screen.
else
    MsgBox The icon was found at %FoundX%x%FoundY%.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help with BitMap

18 Mar 2018, 10:33

Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.
I am your average ahk newbie. Just.. a tat more cute. ;)
zarioftw
Posts: 6
Joined: 18 Mar 2018, 08:37

Re: Help with BitMap

18 Mar 2018, 11:26

Nwb wrote:Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.

Ok so, ahk finds the bitmap while im off the client, for example when i click on desktop. (bmp image on desktop) but not on the actual java client. which is the same problem
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help with BitMap

18 Mar 2018, 11:28

zarioftw wrote:
Nwb wrote:Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.

Ok so, ahk finds the bitmap while im off the client, for example when i click on desktop. (bmp image on desktop) but not on the actual java client. which is the same problem
Question. How big is the image? And yea this is running out of my scope but I hope somebody else can help you, because I don't think even the size should be affecting imagesearch so I don't know what I'm talking about anymore. This happens to me but I just gave up and found alternatives. Googling might be helpful meanwhile.
I am your average ahk newbie. Just.. a tat more cute. ;)
zarioftw
Posts: 6
Joined: 18 Mar 2018, 08:37

Re: Help with BitMap

18 Mar 2018, 11:38

Nwb wrote:
zarioftw wrote:
Nwb wrote:Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.

Ok so, ahk finds the bitmap while im off the client, for example when i click on desktop. (bmp image on desktop) but not on the actual java client. which is the same problem
Question. How big is the image? And yea this is running out of my scope but I hope somebody else can help you, because I don't think even the size should be affecting imagesearch so I don't know what I'm talking about anymore. This happens to me but I just gave up and found alternatives. Googling might be helpful meanwhile.
Been aching my head around this the whole day, googling was my first guarantee at first, but it lead me nowhere. The image size is actually pretty small, ill try to find a backdoor to this. likewise thanks for the help
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help with BitMap

18 Mar 2018, 11:44

zarioftw wrote:
Nwb wrote:
zarioftw wrote:
Nwb wrote:Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.

Ok so, ahk finds the bitmap while im off the client, for example when i click on desktop. (bmp image on desktop) but not on the actual java client. which is the same problem
Question. How big is the image? And yea this is running out of my scope but I hope somebody else can help you, because I don't think even the size should be affecting imagesearch so I don't know what I'm talking about anymore. This happens to me but I just gave up and found alternatives. Googling might be helpful meanwhile.
Been aching my head around this the whole day, googling was my first guarantee at first, but it lead me nowhere. The image size is actually pretty small, ill try to find a backdoor to this. likewise thanks for the help
Maybe you need a different kind of image search function entirely. Because imagesearch doesn't work for me when I'm trying to search for images that are 10x10 for example.
I am your average ahk newbie. Just.. a tat more cute. ;)
zarioftw
Posts: 6
Joined: 18 Mar 2018, 08:37

Re: Help with BitMap

18 Mar 2018, 11:51

Nwb wrote:
zarioftw wrote:
Nwb wrote:
zarioftw wrote:
Nwb wrote:Nothing should interfere with imagesearch as such. The client doesn't matter because imagesearch doesn't deals with only the screen not the client.

Try running

Code: Select all

F1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, plo.bmp
If Errorlevel = 0
Msgbox Found
If ErrorLevel = 1
Msgbox Not Found
else
Msgbox ERROR
return
When you're on the screen where the image is visible.

Ok so, ahk finds the bitmap while im off the client, for example when i click on desktop. (bmp image on desktop) but not on the actual java client. which is the same problem
Question. How big is the image? And yea this is running out of my scope but I hope somebody else can help you, because I don't think even the size should be affecting imagesearch so I don't know what I'm talking about anymore. This happens to me but I just gave up and found alternatives. Googling might be helpful meanwhile.
Been aching my head around this the whole day, googling was my first guarantee at first, but it lead me nowhere. The image size is actually pretty small, ill try to find a backdoor to this. likewise thanks for the help
Maybe you need a different kind of image search function entirely. Because imagesearch doesn't work for me when I'm trying to search for images that are 10x10 for example.
There's something more strange, when i set up a simple click code the cursor goes the coordinates given, jumps to the other side of the screen. Then jumps back.. Im really lost here

Code: Select all

 #NoEnv

CoordMode Screen

loop 5
{
MouseClick, left, 845, 490
sleep, 1500
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 165 guests