ACA - AutoColorAid by Nielsie95
nielsie95
2007-07-02 15:37:00
ACA a.k.a. AutoColorAid
by Nielsie95
This is a snippet which helps you to autocolor something. You enter as much colors as you can get and the script will create an autocolor procedure using RGB, HSL or XYZ.
The script itself will decide which is the best to use :)
It also sets the best ColorToleranceSpeed and Tolerance.
I also integrated the snippet from Boreas which helps you to get the best color from a bitmap :).

Please comment, suggest and test. :)Credits to RkRoxPunk for helping me with the name :D
Credits to Wizzup for the ColorToleranceSpeed compare. :)
Credits to Sumilion for the updated AutoColor Function :)
Credits to Tarajunky for getting the best color + tol from the array! :)
Credits to Boreas for the Color from Bitmap :)
older version downloads: 155.
Nielsie95
rkroxpunk
2007-07-02 15:40:57
niel's wheels colour shmuller :D
anywayz…yay first post…worked great for me on the grey MM rocks with 10 colours. well done
Pentti
2007-07-02 15:43:58
Cant check it out now, but I may test it later.
But it looks just great!
tarajunky
2007-07-02 16:13:36
It looks like it automatically picked the first number in the series as the generic search color. It would be better if you found the median number and used that, since it should reduce the tolerance needed.
crossback7
2007-07-02 16:14:21
Works well. . .I'm using it for my Chicken Obliterator script. . .Until I can figure out how to do it myself or something :p
Smartzkid
2007-07-02 16:32:18
Looks real cool; gonna try it out
Hugolord
2007-07-02 16:44:26
this looks cool needed this thanks!
nielsie95
2007-07-02 17:16:35
Thanks for the great comments :)
Tara:
Maybe you could help me with that one? I've tried getting the best color, but the Results in Tolerance are staying the same. I think it doesn't matter which color is first, or I'm doing something wrong here.
I tried it like this:
ColorToleranceSpeed(Cts);
SetArrayLength(ColCount, Length(Colors));
for i := 0 to Length(Colors) -1 do
for c := 0 to Length(Colors) -1 do
if c <> i then
ColCount[i] := ColCount[i] + SimC(Colors[i], Colors[c]);
c := 0;
for i := 0 to Length(Colors) -1 do
if Min(ColCount[c], ColCount[i]) <> ColCount[c] then c := i;
WriteLn('Best Color: '+IntToStr(Colors[c]));
In the example above I got 1190948 as best color.
But I'm getting the same results with Tolerance..
tarajunky
2007-07-02 22:38:29
ColorToleranceSpeed(Cts);
SetArrayLength(ColCount, Length(Colors));
for i := 0 to Length(Colors) -1 do
for c := 0 to Length(Colors) -1 do
if SimC(Colors[i], Colors[c]) > ColCount[i] then
ColCount[i] := SimC(Colors[i], Colors[c]);
c := 0;
for i := 0 to Length(Colors) -1 do
if Min(ColCount[c], ColCount[i]) <> ColCount[c] then c := i;
WriteLn('Best Color: '+IntToStr(Colors[c]));
That should work. The way you had it before you added up the total tolerance difference between all the numbers, which is the same for every number in the series. (Like an extreme number might be 5, 10, 90 while a middle number might be 30,35,40, they add up to the same amount but one is much worse than the other) You only want to know the maximum tolerance for each color to each other color. Then you pick the color with the lowest value.
BobboHobbo
2007-07-03 07:34:49
Nice, i needed this thnx.
Mjordan
2007-07-03 08:33:13
Wow very nice nielsie. It amazes me how you just came to these forums and started owning everyone :p
BTW you remind me of Boreas, he always codes unique things like this.
Santa_Clause
2007-07-03 09:24:14
He reminds me of Fawki. Can you believe Nielsie actually asked someone how to do something?!!
Janilabo
2007-07-03 10:37:38
From: Mjordan
BTW you remind me of Boreas, he always codes unique things like this.
Haha, same here.. He also reminds me of Ron/SKy Scripter/The_Rs_Monkey.. :p
That's a nice 'utility' you have there, Nielsie - definitely useful one! Thanks.
By the way Nielsie, can you hear people yelling… "Make form! Make form! Make form!"? I can.. :D
Ruroken
2007-07-03 11:10:47
oh thats cool.
Nice work :)
bullzeye95
2007-07-03 19:59:58
Nice work! Just tested it. Perfect! Although I think the CountColor > 50 should be reduced to around 10 or so… and some people want to search in the main screen, not the minimap. So maybe you could make an option for that?
Form pl0cks?
:p
Wanted
2007-07-03 20:10:33
Although I think the CountColor > 50 should be reduced to around 10 or so… and some people want to search in the main screen, not the minimap. So maybe you could make an option for that?
It's easier to just edit the code after you paste it…
bullzeye95
2007-07-03 20:25:06
Yeah, I know. But I didn't realize that it was searching the minimap for about ten minutes. I was getting pretty mad :p
SKy Scripter
2007-07-04 01:22:02
nice BTW ;)
Lol Should Have really Made the RGB in order not the color XD
program New;
procedure DeleteColorItem(var ColorData : TIntegerArray; Index : Integer);
var
i : integer;
begin
if (InRange(Index, 0, GetArrayLength(ColorData)-1)) then
begin
for i := index to GetArrayLength(ColorData)-2 do
ColorData[i] := ColorData[i + 1];
SetArrayLength(ColorData, GetArrayLength(ColorData)-1);
end;
end;
procedure DeleteColorValue(var ColorData : TIntegerArray; Value : Integer);
var
i, Length : integer;
begin
Length := GetArrayLength(ColorData);
for i := 0 to Length-1 do
begin
if (ColorData[i] = Value) then
begin
DeleteColorItem(ColorData, i);
Exit;
end;
end;
end;
function OrganizeColors(DataColor : TIntegerArray) : TIntegerArray;
var
i : integer;
begin
for i := 0 to GetArrayLength(DataColor)-1 do
begin
SetArrayLength(Result, GetArrayLength(Result)+1);
Result[GetArrayLength(Result)-1] := AMax(DataColor);
DeleteColorValue(DataColor, Result[GetArrayLength(Result)-1]);
end;
end;
// Finds The Middle 1, 2, 3*, 4, 5
function AMid(Data: TIntegerArray) : Integer;
var
n : TIntegerArray;
begin
n := OrganizeColors(Data);
Result := n[GetArrayLength(n)-1];
end;
function AMin(Data : TIntegerArray) : Integer;
var
Min, i : integer;
begin
if (GetArrayLength(Data) = 0) then Exit;
Min := Data[0];
for i := 0 to GetArrayLength(Data)-1 do
if (Data[i] < Min) then
Min := Data[i];
Result := Min;
end;
var
T : TIntegerArray;
Min, Mid, Max : Integer;
R, G, B : array [1..3] of Integer;
begin
SetArrayLength(T, 5);
T[0] := 10; // Colors
T[1] := 20;
T[2] := 30;
T[3] := 40;
T[4] := 50;
Min := AMin(T);
Mid := AMid(T);
Max := AMax(T);
ColortoRGB(Min, R[1], G[1], B[1]);
ColortoRGB(Mid, R[2], G[2], B[2]);
ColortoRGB(Max, R[3], G[3], B[3]);
writeln('Min Color : R:' + Inttostr(R[1]) + ' B:' + Inttostr(B[1]) + ' G:' + Inttostr(G[1]));
writeln('Mid Color : R:' + Inttostr(R[2]) + ' B:' + Inttostr(B[2]) + ' G:' + Inttostr(G[2]));
writeln('Max Color : R:' + Inttostr(R[3]) + ' B:' + Inttostr(B[3]) + ' G:' + Inttostr(G[3]));
// Writeln('Middle Color = ' + IntToStr(GetMiddle(T)));
end.
Infantry001
2007-07-05 09:49:25
Awesome tool, Nielsie! Ill be sure to use it :D Ill let you know how it works out.
nielsie95
2007-07-05 10:25:38
Thanks, updated it a bit to use the best color out the array (thanks Tara :))!
Next: Forms! :p
Sumilion
2007-07-05 11:13:28
I took the liberty of changing your function a little … you see, lets say there are 50 pixels with the to be autocolored color .. then it will check all those 50pixels while they are the same color … so i added a little unique color function to it, see if you want to add it or not. (ps. i havent tested it, but i know the unique color thing works …)
WriteLn(' ');
WriteLn('function AutoColorIt: Integer;');
WriteLn('var');
WriteLn(' '+RangeNames[0]+', '+RangeNames[1]+', '+RangeNames[2]+': '+RangeNames[4]+';');
WriteLn(' Points: TPointArray;');
WriteLn(' Colors, UniqueColors: TIntegerArray;');
WriteLn(' i, a: Integer;');
WriteLn(' NewColor: Boolean;');
WriteLn('begin');
WriteLn(' if not LoggedIn then Exit;');
WriteLn(' ColorToleranceSpeed('+IntTostr(CTS)+');');
WriteLn(' FindColorsSpiralTolerance(MMCX, MMCY, Points, '+IntToStr(BColor)+', MMX1, MMY1, MMX2, MMY2, '+IntToStr(Tol[CTS][1] + 2)+');');
WriteLn(' if Length(Points) < 1 then Exit;');
WriteLn(' Colors := GetColors(Points);');
WriteLn(' ');
WriteLn(' for i := 0 to Length(Colors) -1 do');
WriteLn(' begin');
WriteLn(' NewColor := True;');
WriteLn(' for a := 0 to GetArrayLength(UniqueColors) - 1 do');
WriteLn(' begin');
WriteLn(' if(UniqueColors[a] = Colors[i])then');
WriteLn(' NewColor := False;');
WriteLn(' end;');
WriteLn(' if(NewColor)then');
WriteLn(' begin');
WriteLn(' SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);');
WriteLn(' UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];');
WriteLn(' end;');
WriteLn(' end;');
WriteLn(' for i := 0 to Length(UniqueColors) -1 do');
WriteLn(' if UniqueColors[i] <> 0 then ');
WriteLn(' begin');
WriteLn(' '+RangeNames[3]+'(UniqueColors[i], '+RangeNames[0]+', '+RangeNames[1]+', '+RangeNames[2]+');');
WriteLn(' if ('+RangeNames[0]+ ' < ' + FloatToStr(Round(Ranges[0][1]) + 2) + ') and ('+RangeNames[0]+ ' > ' + FloatToStr(Round(Ranges[0][0]) - 2) + ') then ');
WriteLn(' if ('+RangeNames[1]+ ' < ' + FloatToStr(Round(Ranges[1][1]) + 2) + ') and ('+RangeNames[1]+ ' > ' + FloatToStr(Round(Ranges[1][0]) - 2) + ') then ');
WriteLn(' if ('+RangeNames[2]+ ' < ' + FloatToStr(Round(Ranges[2][1]) + 2) + ') and ('+RangeNames[2]+ ' > ' + FloatToStr(Round(Ranges[2][0]) - 2) + ') then ');
WriteLn(' if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then ');
WriteLn(' begin');
WriteLn(' WriteLn(''AutColor: ''+IntTostr(UniqueColors[i]))');
WriteLn(' Result := UniqueColors[i];');
WriteLn(' Break;');
WriteLn(' end;');
WriteLn(' end; ');
WriteLn(' ');
WriteLn(' ColorToleranceSpeed(1);');
WriteLn('end;');
tarajunky
2007-07-05 12:23:02
It would also be helpful to know what the maximum tolerance is for the best color.
So after the Best Color line you should add this…
Writeln('Max Tol = '+IntToStr(ColCount[c]));
Then if you want to use that color as a point in a DTM or something, you just use that color and that tolerance + 5 or 10 and it should find the color pretty much every time. The more points you have in the array, the more accurate your color range should be, and the less you need to add to the tolerance. So, if you only have 5 data points you might want to add 15. If you have 60 data points maybe only add 3 or 5.
nielsie95
2007-07-05 13:06:54
Thanks! :)
Updated it a little again. Now uses the updated AutoColorTemplate from Sumilion! :)
@Tara: It already showed the max tolerance, I made it a bit more clear now ;)
Sumilion
2007-07-05 13:10:06
No problem :)
Too bad ACA didnt do the trick for me … my color is too complicated :)
nielsie95
2007-07-05 13:19:40
It's more supposed to give you hints on colors, tolerance, tolerancespeed etc..
The AutoColorFunction is a nice addition, but is too global too really autocolor :)
btw: Mind telling me what those colors are? :p
Sumilion
2007-07-05 13:24:57
The color of the copper rocks on the minimap :p
Hugolord
2007-07-05 13:46:58
From: Sumilion
The color of the copper rocks on the minimap :p
alright so i tried brute force auto coloring a few days ago and i noticed it does not work on most colors as in some worlds alright its fine color is almost the same but some worlds the colors is COMPLETELY different although it might still be possible what if you made it auto color differently depending on the world your at?
nielsie95
2007-07-05 14:15:29
From: Sumilion
Too bad ACA didnt do the trick for me … my color is too complicated :)
Just wanted to try it out myself :p
Works for me :). If you haven't got an autocolor procedure yourself already, you might want to change the last bit to use HSL (max luminance).. Fully based on the AutoColor procedure from ACA. :)
function AutoColorIt: Integer;
var
R, G, B: Integer;
Points: TPointArray;
Colors, UniqueColors: TIntegerArray;
i, a: Integer;
NewColor: Boolean;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 3232641, MMX1, MMY1, MMX2, MMY2, 36);
if Length(Points) < 1 then Exit;
Colors := GetColors(Points);
for i := 0 to Length(Colors) -1 do
begin
NewColor := True;
for a := 0 to GetArrayLength(UniqueColors) - 1 do
begin
if(UniqueColors[a] = Colors[i])then
begin
NewColor := False;
Break;
end;
end;
if(NewColor)then
begin
SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
end;
end;
SetArrayLength(Colors, 0);
for i := 0 to Length(UniqueColors) -1 do
if UniqueColors[i] <> 0 then
begin
ColorToRGB(UniqueColors[i], R, G, B);
if (R < 158) and (R > 107) then
if (G < 103) and (G > 61) then
if (B < 82) and (B > 27) then
if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
begin
SetArrayLength(Colors, Length(Colors) +1);
Colors[Length(Colors) -1] := UniqueColors[i];
end;
end;
a := 0;
if Length(Colors) < 1 then Exit;
for i := 0 to GetArrayLength(Colors) -1 do
if Max(a, Colors[i]) <> a then a := Colors[i];
//WriteLn('['+IntToStr(i)+'] Color: '+IntToStr(Colors[i]));
Result := a;
WriteLn('AutoColor: '+IntToStr(a));
ColorToleranceSpeed(1);
end;
Colors I used:
procedure SetupColors;
begin
Colors :=
[4940956, 2970508, 4087437, 2904953, 4284815, 2965625, 4088199, 1919856, 3035757,
2441070, 3957144, 4741772, 3232641, 2902133, 5267860, 3295088, 3758479, 2706034,
4218516, 1918317, 4612493, 4677005, 4351370, 4544918, 3690640, 2573945, 2181240]; //Set your colors in here and hit play!
end;
~alex~
2007-07-05 14:27:57
Omg, stop coming out with so much ownage stuff! You make the rest of us look bad :P
Sumilion
2007-07-05 15:05:08
From: nielsie95
Just wanted to try it out myself :p
Works for me :). If you haven't got an autocolor procedure yourself already, you might want to change the last bit to use HSL (max luminance).. Fully based on the AutoColor procedure from ACA. :)
function AutoColorIt: Integer;
var
R, G, B: Integer;
Points: TPointArray;
Colors, UniqueColors: TIntegerArray;
i, a: Integer;
NewColor: Boolean;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 3232641, MMX1, MMY1, MMX2, MMY2, 36);
if Length(Points) < 1 then Exit;
Colors := GetColors(Points);
for i := 0 to Length(Colors) -1 do
begin
NewColor := True;
for a := 0 to GetArrayLength(UniqueColors) - 1 do
begin
if(UniqueColors[a] = Colors[i])then
begin
NewColor := False;
Break;
end;
end;
if(NewColor)then
begin
SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
end;
end;
SetArrayLength(Colors, 0);
for i := 0 to Length(UniqueColors) -1 do
if UniqueColors[i] <> 0 then
begin
ColorToRGB(UniqueColors[i], R, G, B);
if (R < 158) and (R > 107) then
if (G < 103) and (G > 61) then
if (B < 82) and (B > 27) then
if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
begin
SetArrayLength(Colors, Length(Colors) +1);
Colors[Length(Colors) -1] := UniqueColors[i];
end;
end;
a := 0;
if Length(Colors) < 1 then Exit;
for i := 0 to GetArrayLength(Colors) -1 do
if Max(a, Colors[i]) <> a then a := Colors[i];
//WriteLn('['+IntToStr(i)+'] Color: '+IntToStr(Colors[i]));
Result := a;
WriteLn('AutoColor: '+IntToStr(a));
ColorToleranceSpeed(1);
end;
Colors I used:
procedure SetupColors;
begin
Colors :=
[4940956, 2970508, 4087437, 2904953, 4284815, 2965625, 4088199, 1919856, 3035757,
2441070, 3957144, 4741772, 3232641, 2902133, 5267860, 3295088, 3758479, 2706034,
4218516, 1918317, 4612493, 4677005, 4351370, 4544918, 3690640, 2573945, 2181240]; //Set your colors in here and hit play!
end;
Thats one sick array of colors :)
I had 10, from the same part of rock, from 10 different applets. Ill test it out and see how great it is :p, if it works well, you'll get a special place in my heart ;)
Lalaji
2007-07-05 15:09:32
This is awsome dude. I get this error…
Failed when compiling
Line 36: [Error] (36:13): Unknown type 'TStringArray' in script
What SRL am i supposed to be on?
tarajunky
2007-07-05 17:03:28
From: Sumilion
The color of the copper rocks on the minimap :p
FindStoneColor will find the brown rocks on the minimap. I don't know if you're looking for that or something different, though…
FindRockColor finds the normal gray rocks on the minimap.
Sumilion
2007-07-05 17:09:32
There is a FindStoneColor =O since when ? =S
tarajunky
2007-07-05 23:08:04
3.8, don't you read the release notes?? :p
Sumilion
2007-07-06 05:15:40
From: tarajunky
3.8, don't you read the release notes?? :p
Was probably during my exams :p
You know what, ill just give you both a special place in my heart :)
From: nielsie95
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 5591896, MMX1, MMY1, MMX2, MMY2, 34);
if Length(Points) < 1 then Exit;
Hmm… now if it wont find it … CTS will remain 0, bug ?
n3ss3s
2007-07-06 06:34:10
Sumilion, are you shuor u wanna say "50 pixels" thats huge!
Sumilion
2007-07-06 06:36:27
No its not … 50 pixels is (almost) a 7x7 square … that all around the MM isnt much …
Lalaji
2007-07-06 07:55:04
From: lalaji
This is awsome dude. I get this error…
What SRL am i supposed to be on?
Oh damm.. it dosent use SRL. I feel so stupid.
So why do i get this error?
Failed when compiling
Line 36: [Error] (36:13): Unknown type 'TStringArray' in script
nielsie95
2007-07-06 07:58:07
Do you use Scar Divi?
Janilabo
2007-07-06 08:08:23
I am pretty sure he isn't, as I get that error with v2.03.
nielsie95
2007-07-06 08:22:05
Ok, you need Divi to run it ;)
Sumilion
2007-07-06 08:34:03
nielsie95
2007-07-06 08:42:26
I got it :), thanks. Adjusted ;)
Btw: Did you test the AutoColorFunction(s)?
Lalaji
2007-07-06 12:34:19
YAY it worked on 3.10 !
THANKS MAN!
Sumilion
2007-07-06 14:07:37
From: nielsie95
I got it :), thanks. Adjusted ;)
Btw: Did you test the AutoColorFunction(s)?
As i said, you've gained a special place in my heart :), Tarajunky's procedure is my backup, if yours fails it uses his.
A G E N T
2007-07-06 22:19:37
Thanks for this great utility, it works wonders for finding reliable colour/tol combos. :)
www.srl-forums.com
2007-07-07 03:13:56
Wohh looks nice.
nielsie95
2007-07-09 09:53:14
Updated
Now uses forms. Ability to mark colors, find colors from bitmaps and improved AutoColoring! :)
Divi 3.10 needed!
Janilabo
2007-07-09 10:34:46
All I can say is… OMFG, that's very impressive GUI. :eek:
It is a great tool, with awesome functionality!
Nielsie, you rock! :D
mastaraymond
2007-07-09 11:52:53
From: nielsie95
Updated
Now uses forms. Ability to mark colors, find colors from bitmaps and improved AutoColoring! :)
Divi 3.10 needed!
Well I guess you make such awesome scripts because you are dutch, right? If not I will suicide ;)
Garrett
2007-07-19 16:24:17
This is a great idea… Thanks, it works perfect.
nielsie95
2007-07-22 15:55:16
Thanks, great it worked :)
itSchRis917
2007-07-22 23:38:14
Thanks a lot Nielsie95! It helped a lot with finding the water temple :)
A G E N T
2007-07-23 21:16:05
Ooh n00b question time:
In the original version (w/o GUI), how do you convert [colour1 colour2 colour3…] to an array?
legendaryhero90
2007-07-23 22:24:20
i might actually use this since i stink at picking out actual colors that will work.
Wanted
2007-07-23 23:56:24
Very nice, have you looked into to LAB or HSV or anything else,
very good job with the form btw :D
Bobarkinator
2007-07-28 01:56:41
Very nice Nielsie. I have just gotten into RGB autocoloring and this is the greatest tool ever.
The Claw
2007-08-01 07:40:25
This is the greatest thing ever invented
If someone could post instructions or something on how to use this that would be great :) I have no clue what i'm doing.
I just started messing around with this, and all I can say is…. WOW ….very impressive
Thanks for all the hard work to everyone that contributed to it.
~RAM
Bobarkinator
2007-08-06 19:37:53
Nielsie do you want me to post that fix that I did? Or do you want to release it?
nielsie95
2007-08-17 06:00:55
Please post :) Sorry for the late response.
Hugolord
2007-08-17 09:04:25
From: nielsie95
Please post :) Sorry for the late response.
File access error
SRL Compiled in 79msec.
Successfully executed
too many colors?
nielsie95
2007-08-17 09:43:14
Does it work for you with one color?
Bobarkinator
2007-08-17 22:02:27
Ok I had only found one bug with this script and that is that if you were less than one on a color it would round up which you don't always want it to do so I just made it so it extends HSL and XYZ 2 decimal places.
nielsie95
2007-08-19 05:01:52
With your updated version it doesn't show HSL and XYZ ranges in the first tab?
Bobarkinator
2007-08-19 17:38:37
What do you mean?
Hugolord
2007-08-19 17:54:52
From: nielsie95
Does it work for you with one color?
yes it does
nielsie95
2007-08-20 05:11:33
From: bobarkinator
What do you mean?
I'll send you a screenie when you're on msn ;)
Hugo: Guess it was too many colors then =\
Bobarkinator
2007-08-21 22:53:13
Ok, I'll try to be on at the same time as you.
n3ss3s
2007-08-22 09:43:14
By the way, just noticed, you are pretty uber with forms?
nielsie95
2007-08-22 10:16:05
Thank you :)
Bobarkinator
2007-08-25 11:48:15
Ah, I fixed the problem Nielsie had with my fix (forgetting to have a second result), so here is the updated version. No 0's now.
n3ss3s
2007-08-26 07:55:12
OOps I mixed 50 pixels and 50x50 pixels :p
EDIT: Bob, why do I think your scripters cup is pretty new?
Bobarkinator
2007-08-26 16:25:11
Because it is :p
Fizzi
2007-09-04 14:10:16
ACA keeps crashing for me when I press the Start! button when trying to find Color from BMP. I have 10 BMPs in the list, all of which are about 15x30 with very few 0 pixels (They are anvil BMPs, of the whole anvil).
When I press start! I get a new popup every half a second or so that say Access violation 0052BA4E in scar.exe or something along those lines. In order to stop the popups I have to go to my task manager and close scar. Am I using too many bitmaps? Am I supposed to use smaller bitmaps?
Boreas
2007-09-05 02:47:15
Try smaller bitmaps, all cropped to the same area of the anvil. If that doesn't work try less bitmaps until it does. That is assuming the errors are coming from SCAR doing too much, IDK where they are coming from for sure, but it is a hard working function.
nielsie95
2007-09-05 04:10:25
Or you could try Boreas' base-script.. I took the most of his script, but adjusted some thingies that I maybe shouldn't have done..
Sir R. M8gic1an
2007-09-13 14:12:34
looks amazing :) i'll post how well it worked for me when i come around to having to use autocolor :p
The Claw
2007-10-01 22:34:33
Line 952: [Error] (952:48): Unknown identifier 'MMX1' in script E:\!SCAR\ACA3.scar
When using SCAR 3.12. Works with 3.11 though
Santa_Clause
2007-10-01 23:42:40
From: The Claw
Line 952: [Error] (952:48): Unknown identifier 'MMX1' in script E:\!SCAR\ACA3.scar
When using SCAR 3.12. Works with 3.11 though
Freddy removed the global constants from SCAR 3.12…don't know why.
There's no more MMX1, MMX2 and such…
The Claw
2007-10-02 01:26:53
I know, lol. He removed them so that if runescape updates their screen, he wont have to hard-code the co-ords back into scar again. Instead, the devs can update srl and everyone will have it fixed much quicker, through the svn.
nielsie95
2008-01-13 17:12:28
Major bump, but there are still people who may find a use in this (saw some posts lately about autocoloring). footballjds sent me a compiling version which I updated the first post with :)
footballjds
2008-01-13 17:37:39
you weren't s'posed to mention my name :rolleyes:
MylesMadness
2008-01-13 19:55:58
Cool. I've been wanting to use this but I couldn't get the darn thing to compile
footballjds
2008-01-13 21:17:17
heh myles =p. actouly mylse is the one who brought it up…
he said, "I wish i could use the auto colorer"..
i asked what was wrong and fixored.. really it was quite simple..
a few unknowns because of srl updates. and duplicate ID's..
Negaal
2008-01-14 02:34:42
From: Infintry001
Awesome tool, Nielsie! Ill be sure to use it :D Ill let you know how it works out.
:)
I have always wanted to use them - RGB, HSL or XYZ - since i don't know nothing about them…then your tool is pretty useful there :)
Thx
papenco
2008-01-14 13:54:08
I didn“t understand hatta use it lol.
ZephyrsFury
2008-01-15 06:31:23
Maybe instead of using a colour in the array for the best colour you could get the averages of all the values of the colour components and get the mean value. Then convert it back to a colour using those mean component value. Something like this:
function GenericColour: Integer;
var
TR, TG, TB, AR, AG, AB, R, G, B: Integer;
begin
for i := 0 to High(Colours) do
begin
ColorToRGB(Colours[i], R, G, B);
TR := TR + R; TG := TG + G; TB := TB + B; //Sum of all comps
end;
AR := TR / Length(Colours);
AG := TG / Length(Colours); //Average values
AB := TB / Length(Colours);
Result := RGBToColor(AR, AG, AB); //Tada!
end;
except instead of using RGB you could HSL or XYZ based on your best comparison.
EDIT: Another suggestion would be the option to save the array so it can be used again later. ;)