Results 1 to 12 of 12

Thread: How to repeat FindDTM

  1. #1
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default How to repeat FindDTM

    How do I repeat "FindDTMRotated" so it keeps looking for the DTM until it finds it.
    Simba Code:
    begin
           wait(4000);
           if FindDTMRotated(FromBank3, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
            begin
             Mouse(X, Y, 0, 0, true);
             //P07_ChooseOptionMulti(['ine']);
            End;
           end;

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Simba Code:
    while(not(findDTMRotated(...)))do
    begin
      wait(200+random(50));
      //put failsafe here to get out of infinite loop
    end;

    ?

  3. #3
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    is there a way of doing this using repeat and until?

  4. #4
    Join Date
    Apr 2013
    Posts
    395
    Mentioned
    1 Post(s)
    Quoted
    177 Post(s)

    Default

    Simba Code:
    var
      t: integer;

    marktime(t);
    repeat
      if FindDTMRotated(FromBank3, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
      begin
        Mouse(X, Y, 0, 0, true);
        Break; //break out of the loop if found dtm
      end;
    until timefrommark(t) > 60000; //out of the loop after 60 seconds of not finding

  5. #5
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    it's telling me to "Duplicate identifier 'marktime'"

  6. #6
    Join Date
    Apr 2013
    Posts
    395
    Mentioned
    1 Post(s)
    Quoted
    177 Post(s)

    Default

    Quote Originally Posted by rsbots2013 View Post
    it's telling me to "Duplicate identifier 'marktime'"
    Try changing t to something else. Probably had t declared as something else already.

  7. #7
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by Haxz View Post
    Try changing t to something else. Probably had t declared as something else already.
    I have not used t anywhere else and I'm still getting the same problem

    Simba Code:
    var
      t : integer;
      marktime(t);
        repeat
        if FindDTMRotated(FromBank1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
            begin
              Mouse(X, Y, 0, 0, true);
              break;
            End;
              until timefrommark(t) > 10000

  8. #8
    Join Date
    Sep 2008
    Posts
    754
    Mentioned
    8 Post(s)
    Quoted
    275 Post(s)

    Default

    Quote Originally Posted by rsbots2013 View Post
    I have not used t anywhere else and I'm still getting the same problem

    Simba Code:
    procedure tese1;
    var
      t : integer;
    begin
      marktime(t);
        repeat
        if FindDTMRotated(FromBank1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
            begin
              Mouse(X, Y, 0, 0, true);
              exit;
            End;
              until timefrommark(t) > 10000
    end;
    changed some fields in quote also you can tru changing t to any other alphabetical letter(s)

    your missing begin under the var, also i think exit would work too, it would exit the count and you can direct it to the bext step
    Last edited by samerdl; 05-12-2013 at 09:16 PM.

  9. #9
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    I think I got it to work. What would I need to do if I wanted to continue to a new DTM. What I'm doing is making a DTM path. So example of my script. And it seems like "marktimer: (t);" was wrong its suppose to be "marktimer: (t);"

    Simba Code:
    var
      t : integer;
      marktimer:(t);
      begin
        repeat
        if FindDTMRotated(FromBank1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
            begin
              Mouse(X, Y, 0, 0, true);
              break;
            End;
              until timefrommark(t) > 10000

      begin
          repeat
          if FindDTMRotated(FromBank2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
             FindDTMRotated(FromBankB2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
            begin
              Mouse(X, Y, 0, 0, true);
              break;
            End;
              until timefrommark(t) > 10000
      end;

  10. #10
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    ^
    Simba Code:
    procedure foo();
    var
      t,x,y: integer;
      aFound:extended;
    begin
      marktime(t);

      repeat
        if FindDTMRotated(FromBank1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
        begin
          Mouse(X, Y, 0, 0, true);
          break;
        end;
      until (timefrommark(t) > 10000);

      repeat
        if FindDTMRotated(FromBank2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
        begin
          Mouse(X, Y, 0, 0, true);
          break;
        end;
      until (timefrommark(t) > 10000);

    end;

  11. #11
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    ^
    Simba Code:
    procedure foo();
    var
      t,x,y: integer;
      aFound:extended;
    begin
      marktime(t);

      repeat
        if FindDTMRotated(FromBank1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
        begin
          Mouse(X, Y, 0, 0, true);
          break;
        end;
      until (timefrommark(t) > 10000);

      repeat
        if FindDTMRotated(FromBank2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) or
           FindDTMRotated(FromBankB2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, Pi/30, aFound) then
        begin
          Mouse(X, Y, 0, 0, true);
          break;
        end;
      until (timefrommark(t) > 10000);

    end;
    Thank you!

  12. #12
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by rsbots2013 View Post
    Thank you!
    u might want to put a second marktime(t); after your first repeat-until loop. this will reset timefrommark(t) to 0.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •