Danitheman Posted May 4, 2012 Share Posted May 4, 2012 I want my function to look and click several different DTM's. begin if FindDTM(Bones, x, y, 0, 0, 1253, 545) then begin wait(500); MoveWindMouse(x, y, 1, 1); wait(1000); end; ClickWindMouse(x, y, 3, 3, true); Wait(500); end; How do I add other than only the Bones DTM (is it with a ; or , or other?) Quote Link to comment Share on other sites More sharing options...
Janilabo Posted May 4, 2012 Share Posted May 4, 2012 (edited) If you want to search for DTM1 or DTM2 and then click either one of em that is found, you do this: [scar]if FindDTM(Bones, x, y, 0, 0, 1253, 545) or FindDTM(OtherDTM1, x, y, 0, 0, 1253, 545) or FindDTM(OtherDTM2, x, y, 0, 0, 1253, 545) then begin Wait(150 + Random(50)); ClickWindMouse(x, y, 3, 3, True); Wait(400 + Random(100)); end;[/scar] ..that will click the DTM that was found, then exit. But if you want to find and click multiples, then you could do something like this: [scar]procedure MultiDTMClicking; var i, x, y: Integer; found: Boolean; begin for i := 1 to 4 do begin found := False; case i of 1: found := FindDTM(Bones, x, y, 0, 0, 1253, 545); 2: found := FindDTM(OtherDTM1, x, y, 0, 0, 1253, 545); 3: found := FindDTM(OtherDTM2, x, y, 0, 0, 1253, 545); 4: found := FindDTM(OtherDTM3, x, y, 0, 0, 1253, 545); end; if found then begin Wait(150 + Random(50)); ClickWindMouse(x, y, 3, 3, True); Wait(400 + Random(100)); end; end; end;[/scar] Then just use that in your procedures/functions/mainloop. Remember to rename the OtherDTM*'s with your DTM names, obviously. Also, change the 4 from loop to your DTM count. By the way, ClickWindMouse already moves the mouse, so there is no need for MoveWindMouse. Edited May 4, 2012 by Janilabo Quote Link to comment Share on other sites More sharing options...
Danitheman Posted May 5, 2012 Author Share Posted May 5, 2012 When using you code Janilabo, this is what I get (was compiled successfully) http://imageshack.us/photo/my-images/854/elfi.png/# ---------- Post added at 06:53 PM ---------- Previous post was at 06:25 PM ---------- Nvm solved thanks Quote Link to comment Share on other sites More sharing options...