Results 1 to 8 of 8

Thread: Won't Find Door

  1. #1
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Question Won't Find Door

    Can anyone help me out with this? I'm trying to find the door to the Hardwood Grove on Karmaja Island (p2p side). I'm using basically two functions: a mouse function by YoHoJo (presented in his video tut), and a TPA color-finding function by Naum (from his tut on TPA's) .

    In short when I go to find it SRL complies, but then the mouse doesn't move. I'm sure that my colors are fine because I was using the ACA utility to find them.

    Here's my code. Where did I go wrong?
    Simba Code:
    program new;                        // Edits shown in comments
    {$i srl/srl.simba}

    function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean):Boolean; //by YoHoJo
    begin
      MMouse(x, y, 5, 5);
      if WaitUptext(UpText, 1500*Random(500)) then   //changed this to: (Uptext, 1500 + Random(500))
      begin                                                                   // works fine now
        Result:=True;
        GetMousePos(x, y);
        if RClick then
        begin
          Mouse(X, Y, 5, 5, false);
          Result:=WaitOption(Option, 2000);
          Writeln('CheckAndClick (False - RClick)');
          if Result then FFlag(0);
        end else
        begin
          Mouse(x, y, 5, 5, true);
          Writeln('CheckAndClick (True - LClick)');
          Wait(100 * Random(50));
          FFlag(0);
        end;
      end;
    end;

    function FindGroveDoor: Boolean;
    var
      Dx, Dy: integer;
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      I: integer;

    begin
      FindColorsSpiralTolerance(Dx, Dy, TPA, 3894411, MSX1, MSY1, MSX2, MSY2, 17);
      begin
      ATPA:= SplitTPA(TPA, 20);
      for I := 0 to High(ATPA) do
        if MiddleTPAEX(ATPA[i], Dx, Dy) then
        begin
          case Random(2) of
          0:
            begin
              GetMousePos(Dx, Dy);                               //took out GetMousePos as suggested by Home
              CheckAndClick('door', 'pen', Dx, Dy, true);       // I don't think it would hurt if left in
              Writeln('Found Door');
              Result:= true;
            end;
          1:
            begin                              
              GetMousePos(Dx, Dy);                                // Took this one out, too
              CheckAndClick('door', 'pen', Dx, Dy, false);
              Writeln('Found Door');
              Result:= true;
            end;
          end;
        end else
          Result:= False;
          Exit;
      end;
    end;

    begin
      SetUpSRL;
      ActivateClient;
      FindGroveDoor;
    end.

    This is the camera angle and position when I begin searching for the door. The image after that is what ACA shows when I search for that Color and Tolerance. What changes should be done?



    Last edited by Valithor; 03-20-2012 at 09:57 PM. Reason: edited code error (suggested by Home)

  2. #2
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Remove GetMousePos.

    WaitUptext(UpText, 1500*Random(500)) Change it to WaitUptext(UpText, 1500 + Random(500))


    ~Home
    Last edited by Home; 03-20-2012 at 08:16 PM.

  3. #3
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    It finds far too many potential objects (second picture)

  4. #4
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You should try using ATPAs. You can filter the sizes of them to find the largest object to click. The largest ATPA being the door.

    Here's a great thread that shows many of the current functions that can be used for TPA filtering:
    http://villavu.com/forum/showthread.php?t=49067
    Last edited by DeSnob; 03-20-2012 at 08:11 PM.

  5. #5
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Home
    Remove GetMousePos.
    Done. Will post results here in a minute after results.

    Quote Originally Posted by tehq
    It finds far too many potential objects (second picture)
    Quote Originally Posted by DeSnob
    You should try using ATPAs. You can filter the sizes of them to find the largest object to click. The largest ATPA being the door.
    I thought the ATPA in my script was filtering sizes? Or perhaps I misunderstood what Naum was trying to say with that?

    Added link to the first post to direct to TPA tut I was reading...
    Last edited by Valithor; 03-20-2012 at 08:23 PM.

  6. #6
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default [Resolved] Found the Door

    Sorry for the double post, but after making the corrections that Home suggested I'm finding the door now. Many Many Thanks to everyone who replied and offered excellent help on the issue.

    Will definitely look more into the WizzyPlugin for further help with ATPAs.

    On another note, wtf did they do to my trees? I was just logged in yesterday and they weren't like this! Now I have to update my autocolor files... well played Jagex... well played...


  7. #7
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    your graphic setting seems like it's quite detailed?

  8. #8
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    P1nky, no those are the mininum graphics settings. They must have updated the trees with the most recent update. Grrg... No worries... I'll have my autocolor back to normal in a few.

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
  •