# Thread: [ACA]AutoColorAid v2 - by Nielsie95 and Sumilion

1. ## [ACA]AutoColorAid v2 - by Nielsie95 and Sumilion

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.
Last edited by nielsie95; 08-04-2016 at 06:16 PM.

2. And there it is! Have fun with it, boys 'nd girls

*gives Sumilion the thumbs up*

3. Looks good and looks like exactly what I was after. If only i'd have found it earlier.

Does exactly as it should, created the function i needed in no time.. brilliant.
Thank You Very Much!

4. SRL Member
Join Date
Apr 2007
Location
The Netherlands
Posts
5,563
Mentioned
0 Post(s)
Quoted
0 Post(s)
Nice, now im going to read it xD

Edit:
very nice! cool looks!

ps. could i ask some things about delphi on msn?

5. NICE!!!!!! thanks this is what i need

6. bug bug bug!

SCAR Code:
for i := 0 to arL do  begin    if (Length(ararP[i]) < 10) then Continue;    P := MiddleTPA(ararP[i]);    MMouse(P.x, P.y, 5, 5);    Wait(100 + Random(100));    if (IsUpText('Take')) then    begin;      Break;      Result := True;    end;  end;

shouldnt break be AFTER the result? oh and thats the findobj thing...

another thing

add to the autocolor in the for to do loop

If(Not rs_OnMinimap(arP[i].X, arP[i].Y))Then Continue;

please when i tried it kept getting the compass color (close to it) when i wanted a ladder color..

and add a option to search outwards (spiral)

7. Community Member
Join Date
Jul 2007
Posts
1,438
Mentioned
0 Post(s)
Quoted
0 Post(s)
^- Told you nielsie. This thingy is wonderful though. Mastaraymond colors writelner is pwned now. xD

Just started to write a tutorial few hours ago, but you guys released it *so angry that is going to blow*

8. Retired Developer
Join Date
Mar 2007
Posts
4,814
Mentioned
3 Post(s)
Quoted
3 Post(s)
Cool sum.
I got to test it before of course ...

9. Originally Posted by Negaal
^- Told you nielsie. This thingy is wonderful though. Mastaraymond colors writelner is pwned now. xD

Just started to write a tutorial few hours ago, but you guys released it *so angry that is going to blow*

Hell no . This one is based on SCAR Colors functions, while I mostly use my own color functions, thats why I created my writelner.

10. Originally Posted by JuKKa
bug bug bug!

SCAR Code:
for i := 0 to arL do  begin    if (Length(ararP[i]) < 10) then Continue;    P := MiddleTPA(ararP[i]);    MMouse(P.x, P.y, 5, 5);    Wait(100 + Random(100));    if (IsUpText('Take')) then    begin;      Break;      Result := True;    end;  end;

shouldnt break be AFTER the result? oh and thats the findobj thing...

another thing

add to the autocolor in the for to do loop

If(Not rs_OnMinimap(arP[i].X, arP[i].Y))Then Continue;

please when i tried it kept getting the compass color (close to it) when i wanted a ladder color..

and add a option to search outwards (spiral)
Ah right, will work on all of your suggestions, not entirely sure on the spiral search but who knows

11. Originally Posted by Sumilion
Ah right, will work on all of your suggestions, not entirely sure on the spiral search but who knows
FindColorsSpiralTolerance(startx, starty, bla blaba)

or

SortTPA(TPA, Point(startx, starty));

something like that

12. Originally Posted by JuKKa
FindColorsSpiralTolerance(startx, starty, bla blaba)

or

SortTPA(TPA, Point(startx, starty));

something like that
Yes I know how to spiral search I was not sure if I'd add it or not.

However I already added it. There was an open space in the AutoColor tab

Download the new uploaded package. There is no difference in the name.

13. the attachment is invalid...

14. works for me...

15. Works for me too,

you like spiral feature ? and rs_OnMinimap

16. Originally Posted by Sumilion
Works for me too,

you like spiral feature ? and rs_OnMinimap
Yeah Sexy!

17. looks good guys! Thumbs up to both of you. im going to fool around with it now.

Edit: pretty sweet...all i have to say

edit: your find object function gave me a runtime error. type mismatch on this line
SCAR Code:
ararP := SplitTPAEx(arAP, 10, 10);

edit: nvm this time it worked

18. I love all the icons you used in the program .

How did you get those line numbers?

19. You're welcome for testing Sumilion (A)

It is really nice, I feel special to be one of the first to use it.

20. Oh. My. God.

I just needed something like this today!
Not I won't have to learn new stuff! (Read: Now I'll learn off this!)

Seriously, this is just genious. Freaking genious.
I entered a color and it gives me about 100 lines of leet code.

I love you!

EDIT: Omgggg.

EDIT2: WHY THE **** ISN'T THIS STICKIED YET?!

Edit3: Best object finder ever! Gah.

21. ok, it works now. thanks for this

22. SRL Junior Member
Join Date
Mar 2007
Posts
103
Mentioned
0 Post(s)
Quoted
0 Post(s)
thank you SO much.

This is just the kind of thing I might attempt if I had amazing scripting skills like you two. This will help all scripters and make starting a script much easer for beginners. thank you.

23. SRL Junior Member
Join Date
Oct 2006
Posts
585
Mentioned
0 Post(s)
Quoted
0 Post(s)
this is freaking great! i was running hy's caver and was like hmm ill make a gold/silver miner banker i got all the colors and stuff... i just need some help....

anyone wanna help me add me on msn or pm me

msn tycoon_168@hotmail.com

24. Woooot, I used to love ACA 1. I'm so glad this got released.

25. Very, very good maybe I can find a use for this... thanks!

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•