XxKanexX
2006-02-27 02:03:39
Available in, SRL/SRL/Core/Color.scar.
Made By XxKanexX
Information:
This will search for 1 - 3 similar colors as the inputted color. (Will not result as the given color).
It results in how many colors were found. If a color wasn't found, the array is made -1.
Parameter description:
- function FindSimColorMany(var save: array of integer; many, color, xs, ys, xe, ye, tol, dist: integer; hardsearch: boolean): integer;
It uses an array to save the colors in. Make an array.
var
i: array of integer;
Then, put "i" as the save parameter. (Or whatever your array is named).
Then fill out the rest of the parameters.
- many: Many colors to find. (Can only be 1, 2 or 3.).
- color: The main color that the others will be similar to.
- xs, ys, xe, ye: The box to find them in. (Look around for tutorials on these.).
- tol: The tolerance to start at. (Will rise if the color(s) arn't found.).
- dist: How far away it can look for similar colors.
- hardsearch: Will triple check if a color is not found. (97% more chance of finding a color)
Example:
Once this has compiled, it will save all the colors it has found in the array.
Here's a sample script:
{.include SRL/SRL.scar}
var
i: array of integer;
w, h, found: integer;
Begin
SetupSRL;
Getclientdimensions(w, h);
Found:= FindSimColorMany(i, 3, 4380267, 0, 0, w, h, 5, 10, true);
Writeln('Found '+inttostr(found)+' Colors.');
Writeln('1: '+inttostr(i[1])+', 2: '+inttostr(i[2])+', 3: '+inttostr(i[3]));
End.
Similar:
Similar color finding scripts to this (Made By XxKanexX):
- function FindSimColor(color, xs, ys, xe, ye, tol, dist: integer; hardsearch: boolean): integer;
Author:
Made By XxKanexX