1) howcome I get a
[Runtime Error] : Exception: Access violation at address 006D5701 in module 'scar.exe'. Read of address 00000030 in line 239 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
everytime My script detects a random?
also
do you think this autocoloring function I made is adequite?
SCAR Code:
{*******************************************************************************
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,RMGH, RMGL, RMBH, RMBL, TestColor: Integer;
TP: TPointArray;
begin
FFlag(0); //waits to be safe
FindColorsSpiralTolerance(MMCX, MMCY, TP, ColorToFind, MMX1, MMY1, MMX2, MMY2, 60); //searches for the color from the center out
C2 := High(TP);
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);
RMGH := ((Red - Green) + 4);
RMGL := ((Red - Green) - 4);
RMBH := ((Red - Blue) + 4);
RMBL := ((Red - Blue) - 4);
if InRange((Red - Green),RMGH, RMGL) then
if InRange((Red - Blue),RMBH,RMBL) 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;
end;
WriteLn('Color could NOT be Found!');
Result := 0;
Exit;
end;
if not how can it be improved?
the goal of it is to take any color and autocolor it, to remove the need for a single autcolor for each color