Results 1 to 3 of 3

Thread: Searching for objects within the runescape "main" screen

  1. #1
    Join Date
    Jul 2012
    Location
    England
    Posts
    144
    Mentioned
    1 Post(s)
    Quoted
    28 Post(s)

    Default Searching for objects within the runescape "main" screen

    Hi, I'am creating a bone collector.

    This is the findbone procedure that finds bones until the inventory is full:

    Simba Code:
    procedure FindBone;
      var x, y: integer;

        begin
          if FindObj(x,y, 'ake', 15857114, 10) then
            repeat
              Mouse(x,y,2,2,false);
              ChooseOption('ake');
           repeat
             Wait(1200+random(250));
            Until not IsUpText('ew') or (InvFull);
            until(InvFull);
    end;

    My issue is that it only searches within the very bottom right of the runescape "main" screen (Where your avatar is, and the action happens).

    On a side note, how can I make the search better, how do I add more colour codes to the FindObj() line.

    All help is appreciated.

    Matt

  2. #2
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    Function by Mat:

    Simba Code:
    function FindObj_pX(Mouse:Boolean;pX, pY,Null,Null2: Integer; Mod1,Mod2:Extended;Lol1:String): Boolean;
    var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      FindNormalRandoms;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(Mod1, Mod2);
      If Not Mouse then
      FindColorsSpiralTolerance(MSCX, MSCY, TPA,Null, 190, 140, 320, 230, Null2) else
      FindColorsSpiralTolerance(MSCX, MSCY, TPA,Null, MSX1, MSY1, MSX2, MSY2, Null2);

      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 15, 15);
      For I := 0 to High(ATPA) do
      begin
        MiddleTPAEx(ATPA[i], pX, pY);
        If Mouse then
        begin
          MMouse(pX, pY, 2, 2);
          Wait(300+Random(75));
          If(IsUpTextMultiCustom([Lol1]))  then
          begin
            Result := True;
            GetMousePos(pX, pY);
            Break;
          end;
        end else
          Result := True;
      end;
    end;

    Example of use:

    Simba Code:
    If FindObj_pX(false,pX,pY,13890040,3,0.13, 6.73,'asket') then
      begin
        ClickMouse2(True);
        Wait(2000+Random(200))
        Result := True;
      end;

    Simba Code:
    function FindObj_pX(Mouse:Boolean;pX, pY,Null,Null2: Integer; Mod1,Mod2:Extended;Lol1:String): Boolean;

    Mouse: Set to false if you want to search the entire screen, set to true to search within these coordinates:190, 140, 320, 230, not sure what area they cover but you can find out.

    px, py: mouse coordinates when pointing to the object

    Null, NUll2 : Null is color and Null2 is tolerance

    Mod1, Mod2: Mod1 is hue, Mod2 is Sat

    Lol1: uptext

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Use FindObjEx if you dont know about TPA. When you want a more customizable version of a function always check if there is a +Ex version of it. xs, ys, xe, ye is the search radius so if you want it to search within mainscreen set it as MSX1,MSY1,MSX2,MSY2

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
  •