Results 1 to 8 of 8

Thread: Help with Clicking DTMS

  1. #1
    Join Date
    Apr 2012
    Location
    Land of the Rising Sun
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default Help with Clicking DTMS

    Hey, so I was wondering how to keep trying to click a DTM until it successfully sees the uptext (rightclick).
    Basically I'm trying to climb an obstacle, and it often recognises it, but misclicks so it doesn't bring up the option to climb.
    I have a backup DTM, but it won't use it if it actually see the first DTM and misclicks.

    Any help would be greatly appreciated

    Here's what I have so far:

    Code:
    procedure ClickObstacle2;
    
    var
      x, y, Obstacle2DTM, Obstacle2Backup :Integer;
    
    begin
      Wait(RandomRange(1200, 500));
      Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
      Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');
      If FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        Mouse(x, y, 1, 1, false);
        WaitOption('Climb', 1000);
        StatsGuise('Found Obstacle 2');
      end else
      If FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        Mouse(x, y, 1, 1, false);
        WaitOption('Climb', 1000);
        StatsGuise('Found O2 Backup');
      end else
      begin
        WriteLn('couldnt climb obstacle');
        TerminateScript;
      end;
      FreeDTM(Obstacle2DTM);
      FreeDTM(Obstacle2Backup);
    end;
    Last edited by Thief; 04-27-2013 at 07:15 AM.

  2. #2
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Try this:
    Simba Code:
    procedure ClickObstacle2;
    var
      T,x,y,Obstacle2DTM,Obstacle2Backup: Integer;
    begin
      Wait(RandomRange(1200, 500));
      Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
      Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');

      if not FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
        if not FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
        begin
          WriteLn('couldnt climb obstacle');
          FreeDTM(Obstacle2DTM);
          FreeDTM(Obstacle2Backup);
          TerminateScript;
        end;

    MarkTime(T);
      repeat
        FindNormalRandoms;
        MMouse(X, Y, 10, 10);
        if WaitUpText('UPTEXT OF THE OBJECT', 300) then
          break;
      until(TimeFromMark(T) > 2000)

      if IsUpText('UPTEXT OF THE OBJECT') then
        WaitOption('Climb', 1000);

      FreeDTM(Obstacle2DTM);
      FreeDTM(Obstacle2Backup);
    end;

    This will search for your first DTM, if not found then search for the second; if both are not found your script will terminate. Now if either of your two DTMs are found you will your mouse to the X/Y coordinate that it's found at with a randomness of 10 in both X & Y. It will do this for a maximum of 2 seconds while searching for the UpText of the obstacle (you must supply this), if the UpText is found it will right-click and choose the option "Climb".

    Edit:
    Forgot to add the 'MarkTime(T)' .
    Last edited by Flight; 04-27-2013 at 07:18 AM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  3. #3
    Join Date
    Apr 2012
    Location
    Land of the Rising Sun
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Thanks for the reply. I tested it out. It hovers over the DTM for a few seconds, and the uptext coems up, but it doesn't click it :S

  4. #4
    Join Date
    Sep 2012
    Location
    Australia.
    Posts
    839
    Mentioned
    16 Post(s)
    Quoted
    225 Post(s)

    Default

    If Flight's doesn't work, check if you've installed the correct fonts. I'm going to assume this is for 07, so follow this guide: http://villavu.com/forum/showthread.php?t=99992. You want the font part of that.

  5. #5
    Join Date
    Apr 2012
    Location
    Land of the Rising Sun
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Nah it's for EOC. I'll recheck it with the full uptext.

  6. #6
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by pure_thief View Post
    Thanks for the reply. I tested it out. It hovers over the DTM for a few seconds, and the uptext coems up, but it doesn't click it :S
    Oh my mistake, I forgot to add the right-click.

    Simba Code:
    procedure ClickObstacle2;
    var
      T,x,y,Obstacle2DTM,Obstacle2Backup: Integer;
    begin
      Wait(RandomRange(1200, 500));
      Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
      Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');

      if not FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
        if not FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
        begin
          WriteLn('couldnt climb obstacle');
          FreeDTM(Obstacle2DTM);
          FreeDTM(Obstacle2Backup);
          TerminateScript;
        end;

      MarkTime(T);
      repeat
        FindNormalRandoms;
        MMouse(X, Y, 10, 10);
        if WaitUpText('UPTEXT OF THE OBJECT', 300) then
          break;
      until(TimeFromMark(T) > 2000)

      if IsUpText('UPTEXT OF THE OBJECT') then
      begin
        ClickMouse2(mouse_right);
        WaitOption('Climb', 1000);
      end else
        Writeln('Never found the uptext!');

      FreeDTM(Obstacle2DTM);
      FreeDTM(Obstacle2Backup);
    end;

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  7. #7
    Join Date
    Mar 2007
    Posts
    393
    Mentioned
    1 Post(s)
    Quoted
    98 Post(s)

    Default

    yep right_click was missing, I was just posting it...

  8. #8
    Join Date
    Apr 2012
    Location
    Land of the Rising Sun
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Cool thanks! That seems to be working pretty well.

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
  •