Log in

View Full Version : autocoloring



Shuttleu
04-19-2008, 10:45 PM
well i have read a few tutorials but i cant seem to get any of my own auto colorings to work
this is what i have but it keeps saying that it cant find the color

function FindBankColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : integer;
var
P:array of Tpoint;
begin
GC := 965846;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,60) then
begin
red := (TestColor mod 256);
green := ((TestColor / 256) mod 256);
blue := ((TestColor / 256) / 256);
if Red - Blue <= 230 then if Red - Blue >= 170 then
if Red - Green <= 57 then if Red - Green >= -3 then
if Green - Blue <= 204 then if Green - Blue >= 144 then
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then
begin
Result := TestColor;
WriteLn('BankColor = ' +
IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Bank Color!');
Result := 0;
end;


if anyone can help then thank you soo much

~shut

Cazax
04-19-2008, 11:10 PM
The bank color is too small and you are checking few pixels around it: if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then

Shuttleu
04-20-2008, 07:23 AM
so would i replace it with the one you have put?

~shut

Sumilion
04-20-2008, 09:36 AM
Perhaps a good tip would be to check out ACA. It has a function that will make you an AutoColorFunction

http://www.villavu.com/forum/showthread.php?t=26944?t=29373

Shuttleu
04-20-2008, 09:46 AM
thankyou for that
i am now going out so i will read it when i get back

~shut

Cazax
04-20-2008, 03:59 PM
so would i replace it with the one you have put?

~shut

No, just delete that.

Shuttleu
04-20-2008, 11:01 PM
ok thank you both of you
i have got the auto coloring to work with the auto coloring aid
I'm rep++ both of you

~shut