Page 3 of 3 FirstFirst 123
Results 51 to 74 of 74

Thread: Are MMDots and Flag broken? (Keep talk about it in this thread!)

  1. #51
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    If the flag is on top of everything else, a FindBitmapTolerance should also work, no? (With 0 as transparent colour)



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  2. #52
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,194
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Quote Originally Posted by WT-Fakawi View Post
    Or, you could grab the color of the falg once, and keep it in memory while we are still in the same session. I believe the flag color is stable for the session as long as you stay logged in, no?
    That would keep things simple. You might do a click on MMcentre once to grab the Flag color at script startup, and from that monent on do a simple findcolor like we used to do.
    That's the end result I was talking about but the color Spectrum they are using currently is so wide you have to get the colors dynamicly during runtime on the start up. What I was discribing was like GetFlagColors to be used in conjunction with FindFlag.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  3. #53
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I've looked at it more and come to a conclusion of sorts.

    The flag changes color after an initial click. When you first click it its a lighter color very subtle and then shortly after stays a more darker color.

    Our current methods just aren't fast enough from grabbing from the screen. Freeze should work but doesn't fully (no clue why). Currently the best FindFlag is mormonman's which I'm going to commit for now.

    Edit:
    Maybe not, I'm not getting delays with it. /sigh
    Last edited by Narcle; 12-11-2011 at 05:43 AM.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  4. #54
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Has anyone tried a simple findColors with tolerance and some split/sort TPA work? I don't see why that wouldn't work. I'm still convinced that the major change in colour of the flag is a bug in RS (the same with the pink dots on the MM).

  5. #55
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Has anyone tried a simple findColors with tolerance and some split/sort TPA work? I don't see why that wouldn't work. I'm still convinced that the major change in colour of the flag is a bug in RS (the same with the pink dots on the MM).
    I've been trying some things via TPA to findflag. But don't have the correct TPA sort/find functions in Simba to make it faster.

    I've even been trying something like this which works in theory but the speed/functions aren't there. Also this errors if it doesn't find colors /sigh

    Simba Code:
    Function FindFlag(var X, Y: Integer): Boolean;
    var
      i: integer;
      TPA1, TPA2, FlagTPA, TempTPA, MTPA: TPointArray;
    begin
      FlagTPA := [Point(5, 0), Point(4, 1), Point(4, 2), Point(3, 3), Point(4, 3),
                  Point(2, 4), Point(3, 4), Point(4, 4), Point(1, 5), Point(2, 5),
                  Point(3, 5), Point(4, 5), Point(0, 6), Point(1, 6), Point(2, 6)];
      FindColorsSpiralTolerance(MMCX, MMCY, TPA1, 65536, MMX1, MMY1, MMX2, MMY2, 0);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA2, 14333, MMX1, MMY1, MMX2, MMY2, 40);

      H := High(TPA1);

      for i := 0 to H do
      begin
        TempTPA := CopyTPA(FlagTPA);
        OffsetTPA(TempTPA, Point(TPA[i].x-6, TPA[i].y-14));
        GetSamePointsATPA([TPA2, TempTPA], MTPA);
        if Length(MTPA) = Length(FlagTPA) then
        begin
          Result := true;
          X := TPA[i].x;
          Y := TPA[i].y;
          Exit;
        end;
      end;
    end;
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  6. #56
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Hmm, I feel like we might be over thinking it. What method did we use previously?

  7. #57
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    This should work better.
    Simba Code:
    function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
    var
      MapB, KMTarget, ITarget, W, H,
      I, Dif, Radius, Hi, C: Integer;
      TPA: TPointArray;
      P1, P2: TPoint;
    begin
      case LowerCase(WhatDot) of
        'npc', 'n', 'yellow', 'y': Dif := 4369;
        'item', 'i', 'red', 'r': Dif := 23;
        'player', 'p', 'white', 'w': Dif := 1907997;
        'friend', 'f', 'green', 'g': Dif := 5376;
        'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
        {'clan', 'c', 'orange', 'o': Dif := -1;}
      else
        srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
      end;
      MapB := BitmapFromClient(x1, y1, x2, y2);
      KMTarget := GetKeyMouseTarget;
      ITarget := GetImageTarget;
      SetTargetBitmap(MapB);
      GetBitmapSize(MapB, W, H);
      C := 0;
      if FindColors(TPA, 65536, 0, 0, W - 1, H - 1) then
      begin
        Hi := High(TPA);
        SetLength(Result, Hi + 1);
        for I := 0 to Hi do
        begin
          P1 := Point(TPA[i].x + 1, TPA[i].y);
          P2 := Point(TPA[i].x + 2, TPA[i].y);
          if PointInBox(P1, IntToBox(0, 0, W - 1, H - 1))
            and PointInBox(P2, IntToBox(0, 0, W - 1, H - 1)) then
            if ((FastGetPixel(MapB, P1.x, P1.y)
                  - FastGetPixel(MapB, P2.x, P2.y)) = Dif) then
            begin
              Result[C] := Point(TPA[I].x + x1 + 2, TPA[i].y + y1 - 1);
              Inc(C);
            end;
        end;
      end;
      FreeTarget(GetImageTarget);
      FreeBitmap(MapB);
      SetKeyMouseTarget(KMTarget);
      SetImageTarget(ITarget);
      SetLength(Result, C);
      RAaSTPA(TPA, 3);
    end;

  8. #58
    Join Date
    Jan 2011
    Posts
    121
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    I'm still convinced that the major change in colour of the flag is a bug in RS (the same with the pink dots on the MM).
    These are obviously not bugs. They are directed at stopping us. You have to realize this. Jagex is actively attacking us.

    I'm not saying it like it's anything to be more worried about, but continuing to call these "bugs" is frankly ignorant.

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

    Default

    I don't know if this was never fix.. but I think it may be broken AGAIN..

    I noticed: When the bot clicks the minimap, flag is bright red.. When character starts moving, flag is dark red.. The same goes for the flag stick.. Is this just happening to me alone? or anyone else?

    Character doesn't know that it reached the flag.. I have to use while (ismoving) do wait(1);
    I am Ggzz..
    Hackintosher

  10. #60
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    I don't know if this was never fix.. but I think it may be broken AGAIN..

    I noticed: When the bot clicks the minimap, flag is bright red.. When character starts moving, flag is dark red.. The same goes for the flag stick.. Is this just happening to me alone? or anyone else?

    Character doesn't know that it reached the flag.. I have to use while (ismoving) do wait(1);
    No it happens, and yes I knew about the color change and checked it. It still is same color difference though so technically it should still detect it... but randomly it doesn't, what I'm curious about is WHY...

    Any suggestions not already tried?
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  11. #61
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Narcle can you commit my last function? It is incredibly more stable.

  12. #62
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes I will. There's other stuff I need to commit later tonight as well will do it then.

    Edit: Success!
    Fixed FindFlag!!!! Added bmpFlag to global call
    Fixed FindNPCChatText will now search for more then one word at a time (its not the best fix though)
    Added mormonman's GetMiniMapDotsIn
    Removed unneeded call in SRL for text shadow
    Last edited by Narcle; 12-19-2011 at 03:36 AM.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Fastest and most accurate Flag.


    Simba Code:
    function FindFlag(var X, Y: Integer): Boolean;
    var
      KMTarget, ITarget, I, Hi, Map, W, H: Integer;
      TPA: TPointArray;
    begin
      Result := False;
      Map := BitmapFromString(MMX2 - MMX1, MMY2 - MMY1, '');
      CopyClientToBitmap(Map, MMX1, MMY1, MMX2, MMY2);
      KMTarget := GetKeyMouseTarget;
      ITarget := GetImageTarget;
      SetTargetBitmap(Map);
      GetBitmapSize(Map, W, H);
      FindColors(TPA, 65536, 0, 0, W - 1, H -1);
      FilterPointsDist(TPA, 0, 75.5, W / 2, H / 2);
      Hi := Length(TPA);
      for I := 0 to Hi - 1 do
        if ((FastGetPixel(Map, TPA[I].X - 1, TPA[I].Y - 1) - FastGetPixel(Map, TPA[I].X, TPA[I].Y - 1)) = 6381921) then
        begin
          Result := True;
          X := TPA[I].X + MMX1;
          Y := TPA[I].Y + MMY1;
          Break;
        end;
      FreeTarget(GetImageTarget);
      FreeBitmap(Map);
      SetKeyMouseTarget(KMTarget);
      SetImageTarget(ITarget);
    end;


    ~Home

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

    Default

    Quote Originally Posted by Home View Post
    Fastest and most accurate Flag.
    ~Home

    Testing it atm.. I have to say it finds the flag much faster than before.. Problemo though:

    Every time it reaches the flag, it will wait till a complete stop even if I have FFlag(10); Using SPS_WalkPath(TPointArray);



    Edit:

    What is with the Simba tags.. I've noticed sometimes when editing a post or quoting one, the simba tags get sooo messed up :S
    I am Ggzz..
    Hackintosher

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

    Default

    Quote Originally Posted by ggzz View Post
    Testing it atm.. I have to say it finds the flag much faster than before.. Problemo though:

    Every time it reaches the flag, it will wait till a complete stop even if I have FFlag(10); Using SPS_WalkPath(TPointArray);



    Edit:

    What is with the Simba tags.. I've noticed sometimes when editing a post or quoting one, the simba tags get sooo messed up :S
    Thanks for your input, I will try re produce problem. (I don't use SPS) I will check out SPS walkpath function.


    Edit: Something is wrong with SPS walkPath.




    ~Home
    Last edited by Home; 12-27-2011 at 04:40 PM.

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

    Default

    Quote Originally Posted by Home View Post
    blah
    Thank you Home. SRL's function doesn't work properly. Yours however, works just fine.

  17. #67
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by Home View Post
    Fastest and most accurate Flag.


    Simba Code:
    function FindFlag(var X, Y: Integer): Boolean;
    var
      KMTarget, ITarget, I, Hi, Map, W, H: Integer;
      TPA: TPointArray;
    begin
      Result := False;
      Map := BitmapFromString(MMX2 - MMX1, MMY2 - MMY1, '');
      CopyClientToBitmap(Map, MMX1, MMY1, MMX2, MMY2);
      KMTarget := GetKeyMouseTarget;
      ITarget := GetImageTarget;
      SetTargetBitmap(Map);
      GetBitmapSize(Map, W, H);
      FindColors(TPA, 65536, 0, 0, W - 1, H -1);
      FilterPointsDist(TPA, 0, 75.5, W / 2, H / 2);
      Hi := Length(TPA);
      for I := 0 to Hi - 1 do
        if ((FastGetPixel(Map, TPA[I].X - 1, TPA[I].Y - 1) - FastGetPixel(Map, TPA[I].X, TPA[I].Y - 1)) = 6381921) then
        begin
          Result := True;
          X := TPA[I].X + MMX1;
          Y := TPA[I].Y + MMY1;
          Break;
        end;
      FreeTarget(GetImageTarget);
      FreeBitmap(Map);
      SetKeyMouseTarget(KMTarget);
      SetImageTarget(ITarget);
    end;


    ~Home
    Currently works for my scripts.

  18. #68
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I figured it out. Its not FindFlag making it wrong. In fact because that function is slower it makes it higher chance to detect it. They make the flag disappear randomly for 100-250ms so fast you don't even see it do it (most of the time).

    Tricky little bastards.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Quote Originally Posted by Narcle View Post
    I figured it out. Its not FindFlag making it wrong. In fact because that function is slower it makes it higher chance to detect it. They make the flag disappear randomly for 100-250ms so fast you don't even see it do it (most of the time).

    Tricky little bastards.
    I'v thought a fix for this.

    Yes this is ugly but this works.

    Simba Code:
    FFlag(10);
    FFlag(10);

    ~Home :P

  20. #70
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I have it resolved in SRL5.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  21. #71
    Join Date
    Dec 2011
    Location
    Lubbock, Tx
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Flag; Is now not working for me, but only in certain locations.

    At Yanille it worked, Now I am trying to use it near Seers, and its not working at all. I used the same procedure in both places, just different colors and positions.

    Simba Code:
    Procedure WalkToSpinner;

    Begin
      if not LoggedIn then Exit;
      FindNormalRandoms;
      ClickNorth(True);
      Walking(2717036, 20, Point(576, 59));
      Flag;
      Walking(733019, 20, Point(611, 35));
      Flag;
      Walking(5405324, 20, Point(601, 65));
      Flag;
    End;
    My Scripts:
    [HardRockin] Iron Miner (Best mining exp/hr on this site, that I have found)

  22. #72
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    I figured it out. Its not FindFlag making it wrong. In fact because that function is slower it makes it higher chance to detect it. They make the flag disappear randomly for 100-250ms so fast you don't even see it do it (most of the time).

    Tricky little bastards.
    No it doesn't?

    Simba Code:
    program FlagTracker;
    {$i SRL\SRL.scar}

    var
      x, y: Integer;
      Found: Boolean;

    begin
      ActivateClient;
      Writeln('You now have 2 seconds to place a flag');
      Sleep(2000);
      repeat
        Found := FindColor(x, y, 17378, MMX1, MMY1, MMX2, MMY2);
        MoveMouse(x, y);
        Writeln(Found);
      Until(IsKeyDown(VK_F4));
    end.

    Always was spewing out True until I personally saw the flag disappear, which was when it was spewing out False. It is incredibly fast (since it is a static colour with no tolerance comparison), and I deliberately placed the flag in the top-left corner (which is the area first to be found by FindColor).
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  23. #73
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by HardRockers View Post
    Flag; Is now not working for me, but only in certain locations.

    At Yanille it worked, Now I am trying to use it near Seers, and its not working at all. I used the same procedure in both places, just different colors and positions.

    Simba Code:
    Procedure WalkToSpinner;

    Begin
      if not LoggedIn then Exit;
      FindNormalRandoms;
      ClickNorth(True);
      Walking(2717036, 20, Point(576, 59));
      Flag;
      Walking(733019, 20, Point(611, 35));
      Flag;
      Walking(5405324, 20, Point(601, 65));
      Flag;
    End;
    Recent Simba update messed up FindBitmap making FindFlag messed up.

    Quote Originally Posted by Daniel View Post
    No it doesn't?

    Simba Code:
    program FlagTracker;
    {$i SRL\SRL.scar}

    var
      x, y: Integer;
      Found: Boolean;

    begin
      ActivateClient;
      Writeln('You now have 2 seconds to place a flag');
      Sleep(2000);
      repeat
        Found := FindColor(x, y, 17378, MMX1, MMY1, MMX2, MMY2);
        MoveMouse(x, y);
        Writeln(Found);
      Until(IsKeyDown(VK_F4));
    end.

    Always was spewing out True until I personally saw the flag disappear, which was when it was spewing out False. It is incredibly fast (since it is a static colour with no tolerance comparison), and I deliberately placed the flag in the top-left corner (which is the area first to be found by FindColor).
    Wait what? Are you saying it does or doesn't disappear bc... I have like 50 screen shots to prove otherwise lol.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  24. #74
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Wait what? Are you saying it does or doesn't disappear bc... I have like 50 screen shots to prove otherwise lol.
    Nope, it doesn't. It didn't even in Al-Kharid for me, where you said it "definitely" does. :-/
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

Page 3 of 3 FirstFirst 123

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
  •