SRL Archive - OSR Help

ACA not working


maigel

2012-01-15 07:40:00

Hi,

Recently I bumped into YoHoJo's tutorial on ACA. I instantly was like "Why the hell didn't I use this before".
So I went ahead, downloaded it and started messing with it.
Now the problem is, I'm following exactly what the tutorials says, but still I get this error atleast 95% of the times: "AutoColor failed in finding the color."
Which is called here:
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');

Does anyone know what I am doing wrong?
(My CTS is set to 2)

Example function I used (and failed):

function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(4.17, 0.05);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 6249310, MMX1, MMY1, MMX2, MMY2, 1);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 9.94) and (X <= 10.92) and (Y >= 10.19) and (Y <= 11.20) and (Z >= 11.78) and (Z <= 12.91) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

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

jakeyboy29

2012-01-15 08:45:36

If it didnt find the colour, pick a different one, make sure youre using the latest version.

And next time post on the thread, dont make a new one.

Good luck

loser69

2012-01-15 09:11:34

umm you don't have a procedure?


function AutoColor: Integer;

then during a procedure you could have

findcolorSpiralTolerance(x,y,AutoColor,MSX1, MSY1, MSX2, MSY2,tolerance)


Also colors change a lot I noticed it couldn't find the demon in my stunner script after an hours of casting. I just used the autocoloraid again and opened up my saved file of the demon colors noticed it couldn't detect the colours on the demon so then added the new colors on top of the old ones, reran the function and copy and pasted it over to my script, and its working again.

jakeyboy29

2012-01-15 09:31:40

From: loser69
umm you don't have a procedure?


function AutoColor: Integer;

then during a procedure you could have

findcolorSpiralTolerance(x,y,AutoColor,MSX1, MSY1, MSX2, MSY2,tolerance)


Also colors change a lot I noticed it couldn't find the demon in my stunner script after an hours of casting. I just used the autocoloraid again and opened up my saved file of the demon colors noticed it couldn't detect the colours on the demon so then added the new colors on top of the old ones, reran the function and copy and pasted it over to my script, and its working again.


the colours are dynamic so change a little. As yohojo said in his video, try walking up and down stairs, the colours should reload, and add those to the list!

maigel

2012-01-22 16:13:56

Turns out I ticked "minimap" instead of "mainscreen" in the autocolor function creator window. Obviously it couldn't find the color …. I feel so retarded now lol >.>

YoHoJo

2012-01-22 16:18:55

From: maigel
Turns out I ticked "minimap" instead of "mainscreen" in the autocolor function creator window. Obviously it couldn't find the color …. I feel so retarded now lol >.>


1) Just us looking at the code wouldn't really help ACA is something we need to see/do ourselves.

2) Don't feel retarded at all! I've done that SO MANY times before, and still do it every now and then to this day! We all make mistakes :duh:.