Jump to content
Danitheman

Multiple DTM's

Recommended Posts

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?)

Link to comment
Share on other sites

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 by Janilabo
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...