Auto Color Aid v2
by Nielsie95 and Sumilion
Written in Delphi
UPDATE
This is an outdated program. Please refer to the ACA extension or the remake by CynicRus.
History
AutoColorAid v1 was written in scar, mainly by Nielsie95 and it was released on 07-02-2007. At that time it only had one function, enter a variable number of colors from an object (e.g. a symbol on the minimap) and it would give you a function that would automatically get the exact color from RS. While everything was working fine as it should, there were numerous things that could be improved. Slowly ACA v1 expanded to what some of you might know today, a tool with multiple functionalities, written in scar with a form. One of the most important parts that could be improved, was that it was written in scar. While normal script for RS pretty much demand Scar, this tool did not and running it in scar only made it slow and inconvenient. Thus a goal was set, write it in Delphi, better and nicer than ever!
ACA today
Niels and I teamed up to make what would soon be named ACA v2, in Delphi. We had all the time we needed since we both had vacation at the time we teamed up. We wanted to have first of all have all the features from ACA v1 and maybe even more. At the time of release, our vacations are over, meaning less time to work on it. Luckily it is already finished.
Features
- Color value viewer (RGB, HSL, XYZ values)
- Color range table (Minimum R, Maximum R, Minimum G, Maximum G, etc.)
- Tolerance calculator - will be explained below
- Optionable ColorToleranceSpeed - will be explained below
- Client window - a image copied from your screen, allowing you to pick colors from it
- Color Marking - will be explained below
- Custom search area for Marking Colors
- Bitmap saving - save your image
- Bitmap loading - load a bitmap in ACA
- AutoColor function creator - will be explained below
- FindObject function creator - will be explained below
- Option for RGB / HSL / XYZ range check in both functions
- Save colors in an .ACA file (and load them aswell)
- Client finder (and a RS Finder) - will set the image to the client
ColorToleranceSpeed
There are several methods to determine if 2 colors are similar. Currently there are 3.
- 0: RGB - very similar to CTS 1, but the method of checking if the RGB values are similar is different. Faster, but slightly less accurate
- 1: RGB -Accurate, gets the Red, Green and Blue values of the 2 colors and compares these to eachother
- 2: HSL, this method uses Hue, Saturation and Luminence values to determine if 2 colors are similar
Tolerance Calculator
Using Scar's method of determining if 2 colors a similar, ACA can calculate the tolerance needed to validate with all of the colors selected. It displays this amount in several places in ACA.
Marking of Colors
When you use FindColors in scar, or any other way of finding colors on the client, it is hard to see what scar found. There are certain methods around so that it will save the result as a bitmap, or that it will show the results in Scar's bitmap image, ACA features something similar. It has the ability to color all found points on the image in ACA. This way ACA visualises what it finds, and seeing as ACA's method of finding it is the same as Scar's, it also shows what scar sees.
Example :
function AutoColor: Integer;
One of the best features in ACA, which was the only feature of ACA v1 first release, is the ability to print out a ready to use AutoColor function for the colors that you filled in. Basically you fill in a couple of colors in ACA, select with what methods you want to validate the color, and then ACA produces the function for you.
Methods of validating
- RGB-Check : It will test all found results (using the selected ColorToleranceSpeed) to it's Red, Green and Blue values. The colors found have to be within the range of the Red Green and Blue values previously filled in by the user.
- HSL-Check : Same as RGB-Check, only it checks for Hue, Saturation and Luminence values now.
- XYZ-Check : Same as RGB-Check, but checks for XYZ values (XYZ values are another way of defining colors)
- Example : Let's say you picked 2 colors and filled them in ACA, what kind of colors is not important. You check RGB-Check, so it will make sure that it searches for colors within the RGB Range of the 2 colors.
Red[Color1] = 10
Red[Color2] = 40
Green[Color1] = 100
Green[Color2] = 140
Blue[Color1] = 80
Blue[Color2] = 30
It will then, in the AutoColor function, also make sure that the found colors have a Red value between 10 and 40, a Green value between 100-140 and a Blue value between 30-80
function FindObject(var fx, fy: Integer);
The way of creating this function is very similar to creating AutoColor. There are a couple of differences. There is for starters one more Check Method. This is the Array Length. FindObject(); will search for an object on the MainScreen of RuneScape, it will put these values in a T2DPointArray. In human terms, it will find all possibly right object and store them location in a variable. This variable contains every point of the object, every set of points is stored in what you can imagine as a box. Every object that it finds gets it's own box, Array Length check will make sure that the box is not too small, so that it won't find a couple of pixels of relatively the same color on your armor for example. There is also an Edit box for the Up Text of your object, seems obvious what that does, and there is an Edit box for the max distance. This is the maximum distance that 2 points can have before Scar creates a new 'box' for the object. In the end Scar moves it's mouse through each box to see if the uptext is right.
Both functions...
are printed as scripts really. If you directly copy the content in Scar it can run it immediately. If you want to use the function in your script then copy the part starting from 'function AutoColor:Integer; / FindObject(var fx, fy: Integer):Boolean;' until the last 'end;' (notice the ';' there..)
Last part ...
In the end you will just have to try it out a little to get used to it and test it's capabilities. If there are any bugs, don't hesitate to post them here.