Results 1 to 9 of 9

Thread: Negative TPA's =o

  1. #1
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default Negative TPA's =o

    Bet the title pulled in a lot of people ok so here is what i am proposing I want to find an object but the color of the object varies vastly however hehehe the background color does not very much. So I wanted to know if anyone has tried this or something like this with the tpa returning all the area that doesnt match might be kind of a noob question but it just came to me as an idea I will link a picture of what i discovered

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If I remember correctly you can count the gap in pixels in a TPA (Put the table in to a TPA) and then judge what you need to do based on the gaps.

    You could also ask Flight for his method of finding objects by getting the floor TPA and finding odd colors compared to the floor. He did it for mining nodes, IIRC.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

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

    Default

    I'm a bit confused about it, but if I'm understanding right you're wanting to make a TPA of the unique colors on the mainscreen, yes? If so, let me know if this makes sense to you:
    Simba Code:
    function FilterBackground: TPointArray;
    var
      MSTPA,CommonTPA: TPointArray;
    begin
      MSTPA := TPAFromBox(IntToBox(MSX1, MSY1, MSX2, MSY2));   //Create a TPA of the full main screen ("MainScreen TPA")
      //Set your CTS & modifiers
      FindColorsSpiralTolerance(MSCX, MSCY, CommonTPA, BackgroundColors, MSX1, MSY1, MSX2, MSY2, BackgroundColor_Tolerance); //Make a TPA of all the common colors
      if (Length(CommonTPA) < 1) then
        Exit;

      Result := ClearTPAFromTPA(MSTPA, CommonTPA); //Remove the common colors TPA from the mainscreen TPA for the 'unique' colors
    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..."


  4. #4
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I'm a bit confused about it, but if I'm understanding right you're wanting to make a TPA of the unique colors on the mainscreen, yes? If so, let me know if this makes sense to you:
    Simba Code:
    function FilterBackground: TPointArray;
    var
      MSTPA,CommonTPA: TPointArray;
    begin
      MSTPA := TPAFromBox(IntToBox(MSX1, MSY1, MSX2, MSY2));   //Create a TPA of the full main screen ("MainScreen TPA")
      //Set your CTS & modifiers
      FindColorsSpiralTolerance(MSCX, MSCY, CommonTPA, BackgroundColors, MSX1, MSY1, MSX2, MSY2, BackgroundColor_Tolerance); //Make a TPA of all the common colors
      if (Length(CommonTPA) < 1) then
        Exit;

      Result := ClearTPAFromTPA(MSTPA, CommonTPA); //Remove the common colors TPA from the mainscreen TPA for the 'unique' colors
    end;
    Ya that is exactly what I wanted I didnt know about cleartpafrom that will be very helpful in the long run. How ever I just had a brain spart and decided to go with something like minimap to main screen.... Here is what I have so far:

    Simba Code:
    function MMMS(MM: TPoint): TPoint;
     Var
      X, Y :Extended;
    begin
      X := (((MM.X - 626.5) * 9.81119354838709677419354838709677) + 258.531);
      Y := (((MM.Y - 84.5) * 8.84193548387096774193548387096777) + 175.341);
      Result := Point(Round(X), Round(Y));
    end;

    procedure TakeAllLoot;
    var
      LootTPA : TPointArray;
      i : integer;
    begin
      LootTPA := GetMiniMapDots('red');
      for i := 0 To High(LootTPA) Do
      begin
        MMMS(LootTPA[i]);
        MMouse(MMMS(LootTPA[i]).x, MMMS(LootTPA[i]).y, 2, 2);
        Wait(500);
        if ((IsUpText('Take')) and not(InvFull)) or (IsUpText('ey')) then
        begin
          ClickMouse2(Mouse_Left);
          Wait(RandomRange(600, 700));
          while IsMoving do
            Wait(RandomRange(250, 350));
        end;
      end;

    end;

    however i have noticed that based on the distance you are from the object this wont work ie it needs to locate them with srl_anglehigh because it just converts the locations Stills works well coupled with my walk to loot dot function so it doesnt really fail .

    ps. starting to get a head ach coding this dung script and i still havnt really scripted down a room yet lol might take a nap soon and pick it up again in the morning. Not like i will sleep much anyways because last night when i went to bed all I could think about was how to solve different things in the script. Ah well.

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

    Default

    In that case I believe you'd find this most interesting:
    http://villavu.com/forum/showthread.php?t=72985

    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..."


  6. #6
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    I used something similiar
    Simba Code:
    {*******************************************************************************
    procedure TalkToMolly;
    by: J J
    Description: Talks to Molly at start
    *******************************************************************************}

    procedure TalkToMolly;
    var
      FloorColors, MollyColors: TPointArray;
      SearchBox: TBox;
      MollySplit: T2DPointArray;
      P: TPoint;

    begin
      SearchBox := IntToBox(60, 215, 125, 265);
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.17, 0.54);
      if FindColorsSpiralTolerance(260, 200, FloorColors, 4215386, SearchBox.X1, SearchBox.Y1, SearchBox.X2, SearchBox.Y2, 8) then
        begin
          MollyColors := TPAFromBox(SearchBox);
          MollyColors := ClearTPAFromTPA(MollyColors, FloorColors);
          SplitTPAExWrap(MollyColors, 1, 1, MollySplit);
          SortATPASize(MollySplit, True);
          if Length(MollySplit[0]) > 20 then
            begin
              P := MiddleTPA(MollySplit[0]);
              if Debug then
                begin
                  SMART_DrawBoxes(False, [Searchbox], clYellow);
                  SMART_DrawBoxes(False, [GetTPABounds(MollySplit[0])], clRed);
                  SMART_DrawCircle(False, P, 5, False, clAqua);
                end;
              MMouse(P.X, P.Y, RandomRange(-2, 2), RandomRange(-2, 2));
              Wait(50 + Random(100));
              ClickMouse2(1);
            end;
        end;
    end;

    But in your case MMToMS will most likely be the way to go.

    Script source code available here: Github

  7. #7
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    In that case I believe you'd find this most interesting:
    http://villavu.com/forum/showthread.php?t=72985
    This was a very interesting read. However it seems that when i enter a dungeon for some reason my screen zoom will zoom in really far. Does anyone else have they problem... it messes up the main screen points.... =/

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by getdropped69 View Post
    This was a very interesting read. However it seems that when i enter a dungeon for some reason my screen zoom will zoom in really far. Does anyone else have they problem... it messes up the main screen points.... =/
    Happens to me too. It's part of RS now. Their camera feature is annoying as hell! You have to get out of the section of the zoom radius and it'll go back to normal or just wait for it to render properly lol.

    Happens when running from varrock square to vwb as well. Right between the clothes store and the anvil.
    I am Ggzz..
    Hackintosher

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

    Default

    Quote Originally Posted by Brandon View Post
    Happens to me too. It's part of RS now. Their camera feature is annoying as hell! You have to get out of the section of the zoom radius and it'll go back to normal or just wait for it to render properly lol.

    Happens when running from varrock square to vwb as well. Right between the clothes store and the anvil.
    Indeed it is. :/ To set it back to normal I have to open up the graphics panel again and set the camera zoom to the second bar from the left. It's quite annoying that this angle changes at random times. IMO, Jagex is getting sloppy...

    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..."


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
  •