Jump to content
BlueFlare

Move Mouse to more then 2 Bitmaps

Recommended Posts

Hey Guys,

 

I am scripting a few days on a Programm which have to Find more then 2 'Villages'. First i count the Bitmaps with the Function CountBitmapTolerance. This works really fine. After that im starting a for loop which looks like this:

 

for Int := count downto 1 do
 if(FindBitmapTolerance(bmplittle,x,y,25)=True)then begin
   MoveMouseSmooth(x,y);
   ClickMouse(x,y,true);
   wait(500);
   end;
end;

 

But the Problem is that the Mouse is Switching only from the first to the second village. But there are 11 !

 

I've tried everything, save the x & y coordinates into a Array and much more.......

 

pls can somebody help me ?

 

greez Blue Flare

Link to comment
Share on other sites

This topic came up a while ago on here. I would do something like this:

 

Grab screenshot to bitmap, set client to bitmap

while findbitmap

> save coords in array

> set pixels in the area on bitmap to black to prevent being found again

Set client back to window

Loop through array

> Do clicks

Link to comment
Share on other sites

The problem here is, that you are using FindBitmapTolerance whereas you should be using FindBitmapsTolerance.

 

FindBitmapsTolerance finds ALL the bitmaps from an area and stores the matched coordinates to a TPA (TPointArray/array of TPoint), which you can then use for your needs (like selecting the correct village).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...