BlueFlare Posted October 2, 2012 Share Posted October 2, 2012 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 Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted October 2, 2012 Share Posted October 2, 2012 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 Quote Link to comment Share on other sites More sharing options...
LordJashin Posted October 2, 2012 Share Posted October 2, 2012 I think Janilabo or somebody might have a function that does this for you but idk... Quote Link to comment Share on other sites More sharing options...
Janilabo Posted October 2, 2012 Share Posted October 2, 2012 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). Quote Link to comment Share on other sites More sharing options...
BlueFlare Posted October 3, 2012 Author Share Posted October 3, 2012 Thanks Guys, i solved this problem ;D Quote Link to comment Share on other sites More sharing options...