Log in

View Full Version : AutoColor



HarryJames
04-03-2011, 06:51 PM
I used ACAv2 for this, but I can't seem to find a tree. Would some kind, generous, willing and brilliant person help me out :3?

program AnywhereChopperBurner;
{$DEFINE SMART}
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 5;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := 'harrytorry3+5"gmail.com';
Pass := 'ZezimaIsLeet';
Nick := 'ake';
Active := True;
Pin := '1337';
Member := False;
Integers[1] := 300;
end;
end;

var
axeDTM, tinderboxDTM : integer;
x, y, TreeCol: Integer;

procedure declareDTMs;
Begin
axeDTM := DTMFromString('mwQAAAHic42RgYAhihuAwII4A4nAgDgXiYC AOAGJfIJ7JyMAwDYpnAfEcIJ4HxbOh2MrCAmgaE178n4EwYCQC wwEApZoKSw==');
tinderboxDTM := DTMFromString('mggAAAHicY2NgYMhnZmAoAOJqIC4D4gwgTg biCEYGBm8gDgHiBCBOBOJgIDbVYwfqYsLA/xmwA0YcGAIAUS4GPg==');
End;

Function HJ_FindDTM(which : Integer) : Boolean;
var
x, y : Integer;
Begin
GameTab(25);
Case Which of
1 : Result := FindDTM(tinderboxDTM,x,y,MIX1,MIY1,MIX2,MIY2);
2 : Result := FindDTM(axeDTM,x,y,MIX1,MIY1,MIX2,MIY2);
3 : Begin
GameTab(26);
Result := FindDTM(axeDTM,x,y,MIX1,MIY1,MIX2,MIY2);
End;
End;
End;

function AutoColorTree: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 2709836, MMX1, MMY1, MMX2, MMY2, 23);
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
ColorToHSL(arC[i], H, S, L);

if (H >= 20.73) and (H <= 21.34) and (S >= 34.62) and (S <= 40.97) and (L >= 20.57) and (L <= 30.02) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.66) and (X <= 9.66) and (Y >= 6.00) and (Y <= 12.12) and (Z >= 2.19) and (Z <= 4.87) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;

ColorToleranceSpeed(tmpCTS);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Procedure Chop;
Begin
TreeCol := AutoColorTree;
FindColorSpiralTolerance(x,y,TreeCol,MSX1,MSY1,MSX 2,MSY2,50);
Mouse(x,y,0,0, True);

End;

begin
Smart_Server := 36;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
loginPlayer;
declareDTMs;
{if HJ_FindDTM(1) then writeln('Found Tinderbox');
if HJ_FindDTM(2) then writeln('Found axe in Inv');
if HJ_FindDTM(3) then writeln('Found axe equipped'); }

Chop;

end.

Yago
04-03-2011, 07:06 PM
If that's your real user and pass it would be advisable to change them.

HarryJames
04-03-2011, 07:11 PM
Nah it's not :)
That is my actual email though!

Yago
04-03-2011, 07:14 PM
Just checking :P ... I myself have no idea how to use autocolor or what it is used for so right now my mind is open to anyone who can help James :)

beats-
04-04-2011, 04:07 AM
I'm stuck on the same issue. Please post if you find a solution :P

noidea
04-04-2011, 04:11 AM
Is this designed to autocolour the tree on the minimap or MS?

TomTuff
04-04-2011, 04:23 AM
Try TPA's instead.

Smartzkid
04-04-2011, 04:33 AM
If this is for MS screen finding, I've found that adaptive coloring works well. Define a range of colors for a tree, and then add colors as you go.

EDIT: And yeah, like TomTuff said, use ATPA's for tree detection. FindColorsTolerance with a couple colors, then split the arrays and filter out the smaller groups. The larger groups are your trees.