SRL Archive - OSR Help

Giving values to color speed modifiers, tolerances and colors


t4q

2013-04-27 08:21:06

I need to have like 5 colors and 5 Hue and Sat mods here:
SetColorSpeed2Modifiers(HueMods, SatMods);
if findcolorsspiraltolerance(x, y, TPA, MyColors, MSX1, MSY1, MSX2, MSY2, Tolerances) then

What is best way to give values to them?

EngageTheRage

2013-04-27 08:28:41

as in:

if color1 and color 2 etc… ?

i just use nested if statements and change modifiers each time, however i go 3 deep at most :/

you could have a look at the cs_findcolortolerances that is in the development section, that might be of help to you :D

EDIT: link is here - http://villavu.com/forum/showthread.php?t=101777

Sjoe

2013-04-27 08:39:49


procedure TooManyColors;
var
i: CTS: integer;
Hue, Sat: TExtendedArray;
Col, Tol: TIntegerArray;
TPA1, AllColorsTPA, TpointArray;
ATPA: T2dPointArray // if you're gonna make it an ATPA

begin
CTS := GetColorToleranceSpeed;
Hue := [1, 2, 3, 4, 5];
Sat := [1, 2, 3, 4, 5];
Col := [1, 2, 3, 4, 5];
Tol := [1, 2, 3, 4, 5];

for i := 0 to High(Hue) do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue[i], Sat[i]);
FindColorsTolerance(TPA1, Col[i], MSX1, MSY1, MSX2, MSY2, Tol[i]);
CombineTPAWrap(TPA1, AllColorsTPA, AllColorsTPA);
end;

SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
SplitTPAWrap(MyColorsTPA, 5, ATPA); //makEe your ATPA stuff here :p

Smart_DebugTPA / Smart_DebugATPA // Use that for displaying your findings on smart.


This will loop through all TPA's and store them into 1 . If u don't understand some of the coding then just ask for help.

Creds to Olly: his method , that I used.

t4q

2013-04-27 09:18:44

Thank you, I'm gonna use this later cuz my head's aching ATM
I tried this but it just hovered some random black areas :D


procedure PickStuff;
var
Cols, Tols: array of Integer;
Hues, Sats: array of Extended;
pickTPA: TPointArray;
pickATPA: T2DPointArray;
i, x, y: integer;
begin
if not (loggedin) then
exit;
Cols := [2376307, 4843497, 10725291, 1590349];
Tols := [7, 1, 5, 2];
Hues := [0.48, 0.00, 0.24, 0.09];
Sats := [0.06, 0.00, 0.31, 0.24];
x := MSCx;
y := MSCy;
SetColorToleranceSpeed(2);
for i := 0 to High(Cols) do
begin
SetColorSpeed2Modifiers(Hues[i], Sats[i]);
if findcolorsspiraltolerance(x, y, pickTPA, Cols[i], MSX1, MSY1, MSX2, MSY2, Tols[i]) then
begin
pickATPA := SplitTPAEx(pickTPA, 5, 5);
SortATPAFromMidPoint(pickATPA, point(MSCx, MSCy));
SetLength(pickTPA, 0);
for i := 0 to High(pickATPA) do
begin
SMART_DebugATPA(true, pickATPA);
if Length(pickATPA[i]) < 10 then
Continue;
if MiddleTPAEx(pickATPA[i], x, y) then
begin
SetColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
mmouse(x, y, 3, 3);
if waituptext('ake', 300) then
begin
clickmouse2(mouse_right);
WaitOptionMulti(['icket', 'rrow', 'hread', 'oins', 'rune'], 400);
fflag(0);
end;
end;
end;
end;
end;
end;