Results 1 to 5 of 5

Thread: Need help with a script

  1. #1
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default Need help with a script


    So I have this procedure.

    But the problem is that it keeps finding the DTM in the upper left corner of smart, and it moves mouse at there. First it clicked like as if it was a log but then I added the Uptext failsafe. But it still moves mouse which is not very human-like.

    Can someone please help me with this situation?

    Simba Code:
    procedure ErrorSafe;
    var
    TPA: TPointArray;
    G, H, x, y: Integer;

    begin
      repeat
      begin
        if FindDTMs(MLogs, TPA, MIX1, MIY1, MIX2, MIY2) then
        begin
          Writeln('We left one or more logs behind');
          SortTPAByY(TPA, true);
          H := High(TPA);
          for G := 0 to H do
          begin
            MMouse(x, y, 3, 3);
            if not IsUpText('hogany') then
              Continue;
            Wait(200);
            SendKeys('d', 50 + Random(40), 30 + Random(30));
            Wait(500 + Random(200));
            ClickMouse2(true);
            Wait(1000 + Random(100));
          end;
        end else
        WriteLn('didnt find any logs left');
      end;
      until (not FindDTMs(MLogs, TPA, MIX1, MIY1, MIX2, MIY2));
    end;

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    maybe replace your current MMouse line with,
    Simba Code:
    MMouse(TPA[G].x, TPA[G].y, 3, 3);

  3. #3
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    wtf? I just noticed. What are the x and y? I wonder why this still works. will try using MiddleTPAEx(TPA, x, y) thanks

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    TPA[index].x is the x data member in the TPointArray object at the given index. Each TPoint type has an x and y value. So at the index of a TPA greater than length 0, you'll have a TPoint at an index with an X and Y value.

  5. #5
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    Yeah nevermind I was so confused. MiddleTPAEx wont work because each log has one TPoint. So Ill just do TPA[G].x as you said.

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
  •