PDA

View Full Version : RGB.scar - Work In Progress



pwnaz0r
08-18-2007, 02:53 AM
RGB.scar - A Work in Progress

http://wlmwebstatus.servepics.com/status/pwnaz0r@hotmail.com-16.png

Helpful Links and Scripts Using RGB.scar:

Tutorial Thread - http://www.villavu.com/forum/showthread.php?t=15495?
[SRL]Lumbridge BowStringer - http://www.villavu.com/forum/showthread.php?t=15654


Updates:

8/14/2007 - Project Started
8/17/2007 - Project Beta Released
8/17/2007 - RGB Variable better Utilized
8/18/2007 - FindClosestRGB Released
8/18/2007 - FindRGBTolerance Released / RGB Variabel ReVamped


About The Project:

Well in an effort to promote the use of RGB and to inform scripters of its great uses, I have decided to at least start on the project of bringing RGB colorfinding into the SRL include. The initial beta version only includes the creation of the RGB variable and a few RGB functions that may prove useful. I have only set out the tools, now you, the scripters can use them :).

RGB is useful for many things but the thing I personally believe it to be best for it Autocoloring and Finding tolerance faster.

Goals -

Moderately Increase AutoColoring Techniques [X]
Increase Color Tolerance Finding Techniques [X]
Finding the center of Colors, such as trees [ ]
RGB Variable [X]

More to come...

What it Includes

RGB Variable
CreateRGB
CompareColorsRGBEx
CompareColorsRGB
CompareColorArrayRGB
AutoColorMM
MinArray
FindClosestRGB
ConvertRGB
FindRGBTolerance


To find out how these procedures and functions work, please refer to the tutorial at the top.

Things to be added:

Experemental Colorfinding
This is one of my favorites. Its something I thought of while thinking of ways to speed up the colorfinding. It looks great and it will soon be released!
RGB Component Creator
This is on its way also. Will be just like RadialWalk Helper, etc.
Much More!

RAM
08-18-2007, 02:55 AM
Very Interesting :).....Have you considered creating a plugin to improve efficiency and increase speed ?

pwnaz0r
08-18-2007, 02:58 AM
Ha. Well its not at all an attempt to get into SRL but at least it will possibly spark some interest in RGB. I use RGB quite often in scripting and it is very useful for me. I am not near finished with some of my functions that I am working on so hopefully it will be bigger. Also I'm hoping that alot of people will contribute.

And Yes. I am currently in the process of making one.

dvdcrayola
08-18-2007, 08:09 AM
i am very interested in this.. i will be reading the tutorial and coming back when you add more :D

Killerdou
08-18-2007, 08:12 AM
im willing to make the plugin if needed:)

pwnaz0r
08-18-2007, 03:48 PM
Ok cool I loveit I'll message you right away ;).

R0b0t1
08-18-2007, 05:40 PM
You've inspired me... I'm going to try to make an HSL or CMYK (if scar supports it) include.


When I start making it, we could work together to create some of the fuctions.

pwnaz0r
08-18-2007, 08:35 PM
Yeah that sounds good. I have been wondering if I or someone should do HSL.scar. Anyways add me on msn ( in my sig ).

EDIT : Updated. Now includes an extremely fast (For RGB) colorfinding with Tolerance finder.

dvdcrayola
08-18-2007, 08:40 PM
wow... you just keep coming and coming.. a hit tutorial and an include all in like 2 days?!?!?!

NICE haha.

im liking this stuff. i am going to look at it closely later and try to learn from it.

pwnaz0r
08-18-2007, 08:50 PM
Ha yeah. I haven't been here since about Febuary and I decided that I should make up for lost time ;).

ShowerThoughts
08-18-2007, 09:05 PM
nicve work

R0b0t1
08-18-2007, 09:06 PM
Lol. Well, HSL is coming along nicely. Thing is, I haven't found any way to convert Color32 (IE. Color mod 256) to HSL :p. Poor me...


Nice job on most of the functions, once you're more finished I would try putting it in the SRL new functions forum.

pwnaz0r
08-18-2007, 09:07 PM
nicve work

Thnx ;)


Lol. Well, HSL is coming along nicely. Thing is, I haven't found any way to convert Color32 (IE. Color mod 256) to HSL :p. Poor me...


Nice job on most of the functions, once you're more finished I would try putting it in the SRL new functions forum.

K Get Ill pm you about it ;).

R0b0t1
08-18-2007, 09:09 PM
You respond fast.

Well, I found the stuff to convert from RGB on wikipedia... But I'll get on anyway. I forgot what part of it meant.

pwnaz0r
08-19-2007, 05:17 PM
500th post woot. Alright

n3ss3s
08-19-2007, 05:31 PM
Lookey what I've got for ya if you want! :p

function FindRGBCircleTol(var RgX, RgY: Integer; R, G, B, MidX, MidY, Dist, Tol:
Integer): Boolean;
var
C: Integer;
begin
C := RGBToColor(R, G, B);
Result := FindColorCircleTolerance(RgX, RgY, C, MidX, MidY, Dist, Tol);
end;

Nothing big, but noticed you didnt have finding from circle.

Bobarkinator
08-19-2007, 06:01 PM
Lol n3ss3s you forgot to add in a param on the RGBtoColor for the color spot.

n3ss3s
08-19-2007, 06:05 PM
Lol, there isnt it returns the integer. And it compiles I tested.

Oh and pwn heres another
function GetClosest(RGB: string; ClosestTo, x1, y1, x2, y2, MaxAdd: Integer): Integer;
var
I, C1, C2, R, G, B, TempC, x, y: Integer;
var
TempB: Boolean;
begin
Result := 0;
ColorToRGB(ClosestTo, R, G, B);
for I := 1 to 2 do // 1 = Up, 2 = Down
begin
repeat
case RGB of
'R': begin
case I of
1: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Inc(R);
end;
end;
2: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Dec(R);
end;
end;
end;

'G': begin
case I of
1: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Inc(G);
end;
end;
2: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Dec(G);
end;
end;
end;

'B': begin
case I of
1: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Inc(B);
end;
end;
2: begin
TempC := RGBToColor(R, G, B);
if(not(FindColor(x, y, TempC, x1, y1, x2, y2)))then
begin
Dec(B);
end;
end;
end;
end;


Its not ready, but the meaning of it is to return the closest R, G, or B to the R, G or B of the ClosestTo TColor's RGBs

You can create your own of it if you need or something...

R0b0t1
08-20-2007, 02:10 AM
Function FindRGBTriangleTol(var RgX, RgY: Integer; R, G, B, X1, Y1, X2, Y2, X3, Y3, Tol): Boolean;
Var Col: Integer;
begin;
Col:= RGBToColor(R, G, B);
Result:= FindColorTriangleTolerance(RgX, RgY, Col, X1, Y1, X2, Y2, X3, Y3, Tol);
end;



Lol. Start making the skips.

pwnaz0r
08-20-2007, 03:03 AM
Yup ;). Anyways whenever I have time I will add these functions. School is starting and I'm not allowed to get on SRL during the week (for now). Anyways updated with a link to one of the scripts using RGB.scar. It has it included and I think it shows how well RGB can be used ;).

Kik
08-23-2007, 09:32 PM
Hey, this is probably going to sound like a stupid question, but what is RGB (Red Green Blue), and what is it used for?

R0b0t1
08-23-2007, 10:22 PM
It is a color space.

Well, it's just a way of defining colors, almost like SCAR's colors (Color32). But to use it you usually must go RGBToColor().