SRL Archive - SRL Suggestions

NewAutoColor.scar


Shuttleu

2010-07-12 19:02:54

i think this function in NewAutoColor.scar should have its name changed
{*******************************************************************************
function srl_AutoGetColors(Name: string): TIntegerarray;
By: Wizzup?, Sumilion, XcanadamanX
Description:
*******************************************************************************}
function srl_AutoGetColors(Name: string): TIntegerarray;
var
I, C: Integer;
begin
SetLength(Result, 0);
if Length(srl_refColors) = 0 then
begin
SetupNewAutoColor;
srl_Warn('SetAutoColorReference', 'do not forget to call SetupNewAutoColor once.', warn_Warning);
end;
if not NAC_RefSet then
begin
srl_Warn('srl_AutoGetColor', 'No reference has been set yet.', warn_AllVersions);
Exit;
end;
I := NAC_NTI(Name);
if I > -1 then
begin
if Length(srl_refColors[I].eColors) = 0 then
Exit;
SetLength(Result, Length(srl_refColors[I].eColors) + 1);
Result[0] := NAC_Colors[I];
for C := Low(srl_refColors[I].eColors) to High(srl_refColors[I].eColors) do
begin
if srl_refColors[I].Color > srl_refColors[I].eColors[C] then
Result[C + 1] := Result[0] - iAbs(srl_refColors[I].Color - srl_refColors[I].eColors[C])
else
Result[C + 1] := Result[0] + iAbs(srl_refColors[I].Color - srl_refColors[I].eColors[C]);

{$IFDEF DEBUGNAC}WriteLn('Colors['+InttoStr(C + 1) + ']: ' + InttoStr(Result[C + 1]));{$ENDIF}
end;
end;
end;

and this one should be called srl_AutoGetColors
{*******************************************************************************
function srl_AutoGetColors(Name: string): TIntegerarray;
By: Shuttleu
Description:
*******************************************************************************}
function srl_AutoGetColors(Names: TStringArray): TIntegerArray;
var
i: Integer;
begin
for i:=0 to High(Names) do
begin
SetLength(Result, Length(Result)+1);
Result[i]:= srl_AutoGetColor(Names[i]);
end;
end;

thoughts?

~shut

Coh3n

2010-07-12 19:22:38

To be quite honest, I don't think this has anything to do with the autocoloring system Nava and I wrote (which is what's currently in SRL, and works).

Shuttleu

2010-07-12 19:50:42

its from misc/NewAutoColor.scar

~shut

Coh3n

2010-07-12 20:00:22

Yeah I know, but it doesn't have anything to do with the new autocolors system. Its an old file. It was there before Nava and I wrote the current system.

Shuttleu

2010-07-12 20:07:18

people do still use it though
and if they can get multiple symbol colors at once then it would be easier and better

~shut

MylesMadness

2010-07-12 20:36:44

From: Coh3n
Yeah I know, but it doesn't have anything to do with the new autocolors system. Its an old file. It was there before Nava and I wrote the current system.
Are you saying this needs a rename? You aren't even saying anything. Your just kinda thinking out loud…

3Garrett3

2010-07-12 21:18:27

He's saying it doesn't matter because a better system is in place?

Coh3n

2010-07-12 22:22:24

From: 3Garrett3
He's saying it doesn't matter because a better system is in place?

This. I don't even know what the functions in NewAutoColor.scar do. I was just assuming they had something to do when a new autocolor system that was never finished (since it wasn't added to the core), in which case, Nava and I have written a working autocolors system.

lordsaturn

2010-07-12 23:11:44

Well afaik NewAutoColor.scar is the most secure autocolor possible because it deals with a difference between two colors on a symbol. Rather than guesstimating using an array of integers and a tolerance.

NCDS

2010-07-13 00:20:38

From: lordsaturn
Well afaik NewAutoColor.scar is the most secure autocolor possible because it deals with a difference between two colors on a symbol. Rather than guesstimating using an array of integers and a tolerance.


Then why would it not be used? Just curious.

ZephyrsFury

2010-07-13 03:16:55

From: NCDS
Then why would it not be used? Just curious.


It just never gained enough publicity and popularity. Another reason is because not everything could be autocoloured. I'm not sure if the colours still work or even if the method still works but before it worked briliantly.

Coh3n

2010-07-13 06:00:29

From: ZephyrsFury
It just never gained enough publicity and popularity. Another reason is because not everything could be autocoloured. I'm not sure if the colours still work or even if the method still works but before it worked briliantly.

Perhaps if it still works so well it could be added to AutoColors.scar, or was there a reason it was in misc?

ZephyrsFury

2010-07-13 06:03:50

From: Coh3n
Perhaps if it still works so well it could be added to AutoColors.scar, or was there a reason it was in misc?


Might have been dev only or something. But sure if it works go ahead.

Shuttleu

2010-07-13 06:17:01

From: MylesMadness
I would also like to note that all road colors seem to work in this system.


so maybe Jagex have made it easier for us recently…

~shut

EDIT: if your worried it still doesnt work then i can check them all for you…

Coh3n

2010-07-13 06:21:42

From: Shuttleu
so maybe Jagex have made it easier for us recently…

~shut

EDIT: if your worried it still doesnt work then i can check them all for you…

Where are you quoting that from? Lol

And while your add it, you may as well test the rock colors as well (or did I see them on the list in NewAutoColor.scar?).

Shuttleu

2010-07-13 06:24:45

From: Coh3n
Where are you quoting that from? Lol

And while your add it, you may as well test the rock colors as well (or did I see them on the list in NewAutoColor.scar?).


if you click on the little green arrow in the quote box beside the quoter's name then it will take you to the quote

also grey rock and brown rock are already both in the list

~shut

Coh3n

2010-07-13 06:29:52

Lol I asked because I never saw him say that in this thread.

Shuttleu

2010-07-13 07:02:43

so anyway, can my suggestion be done?
or if not rename the current srl_AutoGetColors then rename my one

it would make it quicker and easier to get multiple colors at once

~shut

Coh3n

2010-07-14 00:07:57

From: Shuttleu
so anyway, can my suggestion be done?
or if not rename the current srl_AutoGetColors then rename my one

it would make it quicker and easier to get multiple colors at once

~shut

Added your function. Called it srl_AutoGetColorsMulti.