Results 1 to 19 of 19

Thread: ColorCounter

  1. #1
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    ColorCounter

    I was thinking of making a scar script that helps you to be sure you pick the right color for your script.
    For scripts that are like color-based it would be easy if you knew if the color you are using is unique/less found, so i made this script.
    This script will count the color that's found in a specify box, it also gives you the coordinates were the color is found! so you can check it out.

    I thought it could be usefull

    FULL CREDITS TO BenLand100 WHO HELPED ME A LOT!! THANK YOU AGAIN!

    Post here what you thought about my idea and if you like it or not, just post something
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could just use FindColorsSpiralTolerance to do the exact same task (pretty sure) But it looks good.

  3. #3
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    You could just use FindColorsSpiralTolerance to do the exact same task (pretty sure) But it looks good.
    why spira-l? no need i think since it have to scan from left to right..
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  4. #4
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by the scar noob View Post
    why spira-l? no need i think since it have to scan from left to right..
    FindColorsTolerance then... that would do the exact same thing, looking from left to right.

    Not trying to put down your function, but I just thought I'd tell you that there's already something built into SCAR that does this.

  5. #5
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    FindColorsTolerance then... that would do the exact same thing, looking from left to right.

    Not trying to put down your function, but I just thought I'd tell you that there's already something built into SCAR that does this.
    i actually use FindColorsSpiral , goign to add tolerance when you want to..
    new const and use that for tolerance
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  6. #6
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What I mean is I don't get what this function does that's different from the scripter just using FindColorsTolerance.

  7. #7
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    It's not a function, it's a utility
    It gives you information.
    Hup Holland Hup!

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    What I mean is I don't get what this function does that's different from the scripter just using FindColorsTolerance.
    Have you actually looked at the script ? It uses FindColorsTolerance .. it just then prints out all points it found.

    @the scar noob, perhaps make it print out the color of the coord aswell ? (*cough*GetColors*cough*). FindColors(Spiral)Tolerance is very important if you want to make a good script, i use it a lot in my rimmington miner, guildminer, yew chopper and powerminer ...
    Administrator's Warning:


  9. #9
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    It's not a function, it's a utility
    It gives you information.
    exactly!
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  10. #10
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sumilion View Post
    Have you actually looked at the script ? It uses FindColorsTolerance .. it just then prints out all points it found.

    @the scar noob, perhaps make it print out the color of the coord aswell ? (*cough*GetColors*cough*). FindColors(Spiral)Tolerance is very important if you want to make a good script, i use it a lot in my rimmington miner, guildminer, yew chopper and powerminer ...
    ok maybe i should add that later, thanks for idea.
    Btw, there isn't any need of using spiral over here right? it has to scan from left to right.. (*cough*unblock me eens op msn *cough*)

    EDIT: sorry for double post everyone
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  11. #11
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sumilion View Post
    Have you actually looked at the script ? It uses FindColorsTolerance .. it just then prints out all points it found.

    @the scar noob, perhaps make it print out the color of the coord aswell ? (*cough*GetColors*cough*). FindColors(Spiral)Tolerance is very important if you want to make a good script, i use it a lot in my rimmington miner, guildminer, yew chopper and powerminer ...
    I use FindColorsSpiralTolerance all the time to! =)

    And no, I actually didn't look at the script.. I just looked at what he said it did and it sounded like it was FindColorsTolerance.

    I get it now though

  12. #12
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Guys, there is a wonderful function in scar called CountColor and CountColorTolerance

    Code:
     function CountColor(Color, x1, y1, x2, y2: Integer): Integer;
    Counts the instances found of Color in the area specified by x1, y1, x2 and y2.
    
    function CountColorTolerance(Color, x1, y1, x2, y2, Tolerance: Integer): Integer;
    Works like the regular CountColor function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.
    Verrekte Koekwous

  13. #13
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Guys, there is a wonderful function in scar called CountColor and CountColorTolerance

    Code:
     function CountColor(Color, x1, y1, x2, y2: Integer): Integer;
    Counts the instances found of Color in the area specified by x1, y1, x2 and y2.
    
    function CountColorTolerance(Color, x1, y1, x2, y2, Tolerance: Integer): Integer;
    Works like the regular CountColor function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.
    rolf i know, nielsie95 told me afterwarths
    but than i couldn't return (or with harder work) the coords were the colors are found (the arrays )
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  14. #14
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Guys, there is a wonderful function in scar called CountColor and CountColorTolerance

    Code:
     function CountColor(Color, x1, y1, x2, y2: Integer): Integer;
    Counts the instances found of Color in the area specified by x1, y1, x2 and y2.
    
    function CountColorTolerance(Color, x1, y1, x2, y2, Tolerance: Integer): Integer;
    Works like the regular CountColor function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.
    Another person that didnt exactly read through the 'utility' and see what it does...

    Quote Originally Posted by the scar noob View Post
    (*cough*unblock me eens op msn *cough*)
    *cough*ik heb je niet geblocked, ben amper online*cough*
    Administrator's Warning:


  15. #15
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Well after i posted it, i saw it didn't actually count the colors but it also added the x and y of the found color. Well i still want to say this, because I've seen scripts that use FindColorsTolerance for color counting . My excuse

    ~Raymond
    Verrekte Koekwous

  16. #16
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    lol this is how my auto roadcolor is based off.. first it trys* to find the color then.. if not found i use..

    SCAR Code:
    function AMostColor(DataColor : TIntegerArray; x1, y1, x2, y2 : Integer) : Integer;
    var
       i, most, index, Length, count: integer;
    begin
    Length := GetArrayLength(DataColor);
      if (Length = 0) then Exit;
      Most := CountColor(DataColor[0], x1, y1, x2, y2);
       for i := 0 to Length-1 do
       begin
          Count := CountColor(DataColor[i], x1, y1, x2, y2);
          if (Count > Most) then
           begin
              Index := i;
              Most := Count;
           end;
       end;
       Result := DataColor[index];
    end;

  17. #17
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sumilion View Post

    *cough*ik heb je niet geblocked, ben amper online*cough*
    *k, txh, kom dan eens meer on *


    Quote Originally Posted by SKy Scripter View Post
    lol this is how my auto roadcolor is based off.. first it trys* to find the color then.. if not found i use..

    SCAR Code:
    function AMostColor(DataColor : TIntegerArray; x1, y1, x2, y2 : Integer) : Integer;
    var
       i, most, index, Length, count: integer;
    begin
    Length := GetArrayLength(DataColor);
      if (Length = 0) then Exit;
      Most := CountColor(DataColor[0], x1, y1, x2, y2);
       for i := 0 to Length-1 do
       begin
          Count := CountColor(DataColor[i], x1, y1, x2, y2);
          if (Count > Most) then
           begin
              Index := i;
              Most := Count;
           end;
       end;
       Result := DataColor[index];
    end;
    wowah nice! got to read it over again to fuly understand it
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  18. #18
    Join Date
    Mar 2007
    Posts
    674
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    prettyu nice, works for me.

  19. #19
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lalaji View Post
    prettyu nice, works for me.
    thx, i want more of that kinda posts, rofl
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

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
  •