SRL Archive - RS3 Outdated / Broken Scripts

ColorCounter


the scar noob

2007-07-08 10:00:32

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 :p

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 :)

JAD

2007-07-08 10:17:13

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

the scar noob

2007-07-08 10:22:26

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


why spira-l? no need i think since it have to scan from left to right..

JAD

2007-07-08 10:23:48

From: the scar noob
why spira-l? no need i think since it have to scan from left to right..


FindColorsTolerance then… :p 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.

the scar noob

2007-07-08 10:30:20

From: JAD
FindColorsTolerance then… :p 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

JAD

2007-07-08 10:45:13

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

nielsie95

2007-07-08 10:51:32

It's not a function, it's a utility ;)
It gives you information.

Sumilion

2007-07-08 10:58:36

From: JAD
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 …

the scar noob

2007-07-08 11:05:03

From: nielsie95
It's not a function, it's a utility ;)
It gives you information.


exactly!

the scar noob

2007-07-08 11:11:32

From: Sumilion
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

JAD

2007-07-08 11:14:30

From: Sumilion
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..:redface: I just looked at what he said it did and it sounded like it was FindColorsTolerance.

I get it now though :p

mastaraymond

2007-07-08 12:12:16

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


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.

the scar noob

2007-07-08 17:43:45

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


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 :p
but than i couldn't return (or with harder work) the coords were the colors are found (the arrays ;))

Sumilion

2007-07-08 17:58:02

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


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…

From: the scar noob
(*cough*unblock me eens op msn *cough*)


*cough*ik heb je niet geblocked, ben amper online*cough*

mastaraymond

2007-07-08 18:15:43

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 :o. My excuse

~Raymond

SKy Scripter

2007-07-08 18:29:37

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


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;

the scar noob

2007-07-10 06:51:54

From: Sumilion


*cough*ik heb je niet geblocked, ben amper online*cough*


*k, txh, kom dan eens meer on :)*


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


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 :p

Lalaji

2007-07-10 07:43:12

prettyu nice, works for me.

the scar noob

2007-07-12 12:53:24

From: lalaji
prettyu nice, works for me.


thx, i want more of that kinda posts, rofl :)