SRL Archive - RS3 Script Requests

TIntegerArray of Colors -> HSL + Tolerance + Best color


TomTuff

2011-03-16 22:40:15

A quick script that calculates HSL mods, tolerance, and the best color of a given TIntegerArray (CTS 2 Obviously) like ACA does would be awesome. I could probably do it if I saw the source on ACA but I have no idea where that is :p

Blumblebee

2011-03-17 14:41:27

I'm 90% sure MastaRaymond made something like this a long long time ago. Try searching through the threads he's made or something like that.

Naum

2011-03-17 15:08:03

Check color.scar in srl core

TomTuff

2011-03-18 01:04:09

Pretty sure those don't work.


program new;
{$i SRL\SRL.scar}


var
Colors: TIntegerArray;

procedure MainLoop;
var
BestColor, Tol: Integer;
Mods: TExtendedArray;
begin
ClearDebug;
Colors := [1384346, 1450139, 1450140, 1384346, 1450139, 1450140];
GetBestColor(Colors, 1, Tol, Mods);
writeln('Best Color: ' + ToSTr(BestColor) + '; Tol: ' + ToStr(Tol) + '; Mods: ' + ToStr(Mods));
end;


begin
MainLoop;
end.

Output:
Best Color: 0; Tol: 2; Mods: []
Successfully executed.

Method

2011-03-18 01:08:26

It would be helpful to assign the result of GetBestColor to BestColor.

TomTuff

2011-03-18 02:04:59

From: Method
It would be helpful to assign the result of GetBestColor to BestColor.


Most helpful indeed, padawan. This would have saved me MINUTES of plugging things into ACA :p Good to know it was me and not the function.