can anyone tell me whats going wrong with this
SCAR Code:
var
ColorToFind: integer;
{*******************************************************************************
function function MyAutoColor: Integer;
By: Tazzin44
Description: autocolors whatever you need just remember to declare the variable
ColorToFind in the procedure/function you are using this in
ColorToFind is, simply put the color you need to autocolor.
*******************************************************************************}
function MyAutoColor: Integer;
var
I, C2, Red, Green, Blue, TestColor: Integer;
TP: TPointArray;
C1 : TIntegerArray;
begin
FFlag(0); //
FindColorsSpiralTolerance(MMCX, MMCY, TP, ColorToFind, MMX1, MMY1, MMX2, MMY2, 70); //searches for the color from the center out
C1 := GetColors(TP);
C2 := High(C1);
for I:=0 to C2 do
begin
if rs_OnMinimap(TP[i].x,TP[I].y) then // checks to see if the color is on the minimap
begin
TestColor := GetColor(TP[I].x,TP[I].y);
ColorToRGB(TestColor, Red, Green, Blue);
if InRange((Red - Green),5,10) then
if InRange((Red - Blue),4,10) then
if GetColor(TP[I].x + 2, TP[I].y + 2) = TestColor then
if GetColor(TP[I].x + 1, TP[I].y + 1) = TestColor then
if GetColor(TP[I].x, TP[I].y + 2) = TestColor then
if GetColor(TP[I].x + 2, TP[I].y) = TestColor then
if GetColor(TP[I].x, TP[I].y + 1) = TestColor then
if GetColor(TP[I].x + 1, TP[I].y) = TestColor then
if GetColor(TP[I].x + 2, TP[I].y + 1) = TestColor then
if GetColor(TP[I].x + 1, TP[I].y + 2) = TestColor then
begin
Result := TestColor;
Writeln('The Color you are looking for = '+IntToStr(Result));
exit;
end;
end;
WriteLn('Color could NOT be Found!');
Result := 0;
Exit;
end;
end;
procedure testwalk;
begin
ColorToFind := 6776944;
MyAutoColor;
RadialWalk(MyAutoColor, 350, 315, 72, 1,1)
end;
begin
setupsrl
testwalk;
end.
I've been making this with the help of tuts/ autocolor.scar (for the range when all my ranges fail) ... i put some writeln's in to debug it and it seems to not pass the statement
SCAR Code:
if GetColor(TP[I].x + 2, TP[I].y + 2) = TestColor then
if any one could offer suggestions? also any suggestions on a more efficient way to making it multi purpose (right now I have it so the variable ColorToFind Is a Global in the script, and then its used value for a single instance is declared in a procedure right before the autcolor is called)