Sir R. M8gic1an
2009-02-15 06:38:04
Not too long ago there was an app that went from being (yes)15 - 3(no) to being 5(yes) - 13(no). Why was this? Most SRL Members didn't recognize Procedures made by Scar Assistant and thus thought the applicant had done some really nice TPAs.
So I thought i'd post an example from both ACA2 and Scar Assistant as i would find it normal that SRL Members only use one of them as they serve the same purpose.
Autocolor By Scar Assistant
Autocolor by ACA2
FindObject by Scar Assistant
FindObject by ACA2
hope you have a close look and remember these the next time you vote. I am not saying applicants should not use ACA or Scar Assistant, that is up to each of you to decide. But at least now none of you will think something that is untrue.
~RM
So I thought i'd post an example from both ACA2 and Scar Assistant as i would find it normal that SRL Members only use one of them as they serve the same purpose.
Autocolor By Scar Assistant
function AutoColor: Integer;
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := -1;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, 5406572, MMX1, MMY1, MMX2, MMY2, 60);
Len := High(P);
for I := 0 to Len do
if RS_OnMinimap(P[I].X, P[I].Y) then
begin
TestColor := GetColor(P[I].X, P[I].Y);
ColorToRGB(TestColor, R, G, B);
if InRange(R - B, 6, 46) then
if InRange(R - G, -39, 1) then
if InRange(G - B, 25, 65) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -32, -2) then
if InRange(Round(S - H), -17, 13) then
if InRange(Round(S - L), -34, -4) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -11, 3) then
if InRange(Round(Y - Z), 1, 15) then
begin
Result := TestColor;
Exit;
end;
end;
end;
end;
WriteLn('Autocolor did not find the color.');
end;
begin
SetUpSRL;
ActivateClient;
Wait(300 + Random(450));
WriteLn('AutoColor = ' + IntToStr(AutoColor));
Disguise('Done.');
end.
Autocolor by ACA2
program AutoColor;
{.include SRL\SRL.scar}
function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 5271393, MMX1, MMY1, MMX2, MMY2, 57);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) then
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 64) and (R <= 130) and (G >= 77) and (G <= 145) and (B >= 47) and (B <= 112) then
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 21.01) and (H <= 26.36) and (S >= 12.92) and (S <= 24.52) and (L >= 24.69) and (L <= 50.02) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 5.42) and (X <= 21.92) and (Y >= 6.77) and (Y <= 25.78) and (Z >= 3.80) and (Z <= 18.87) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
begin
SetupSRL;
AutoColor;
end.
FindObject by Scar Assistant
function AutoColor: Boolean;
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := False;
FFlag(0);
FindColorsSpiralTolerance(MMCX, MMCY, P, 5406572, MMX1, MMY1, MMX2, MMY2, 60);
Len := High(P);
for I := 0 to Len do
if RS_OnMinimap(P[I].X, P[I].Y) then
begin
TestColor := GetColor(P[I].X, P[I].Y);
ColorToRGB(TestColor, R, G, B);
if InRange(R - B, 6, 46) then
if InRange(R - G, -39, 1) then
if InRange(G - B, 25, 65) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -32, -2) then
if InRange(Round(S - H), -17, 13) then
if InRange(Round(S - L), -34, -4) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -11, 3) then
if InRange(Round(Y - Z), 1, 15) then
begin
Mouse(P[I].X, P[I].Y, 6, 6, True);
Result := True;
Exit;
end;
end;
end;
end;
WriteLn('Autocolor did not find the color.');
end;
FindObject by ACA2
function FindObject(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.22, 0.47);
if not(FindColorsTolerance(arP, 5075298, MSX1, MSY1, MSX2, MSY2, 13)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 64) and (R <= 130) and (G >= 77) and (G <= 145) and (B >= 47) and (B <= 112) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 5.42) and (X <= 21.92) and (Y >= 6.77) and (Y <= 25.78) and (Z >= 3.80) and (Z <= 18.87) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
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;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
hope you have a close look and remember these the next time you vote. I am not saying applicants should not use ACA or Scar Assistant, that is up to each of you to decide. But at least now none of you will think something that is untrue.
~RM