Ran 10 tests each on a refreshed client and all were successful (not to mention all the testing while fixing it). It has absolutely perfect detection for me, but I would love if someone else could test too **Hint!
**.
Progress Report by NCDS:
//Try 1
New window: 1245952
Compiled succesfully in 562 ms.
SRL Compiled in 0 msec
Bowl identified in Column 0, Row 0.
Bowl identified in Column 1, Row 1.
Bowl is not visible in Column 2, Fixing that.
Bowl identified in Column 2, Row 0.
Total time: 7223
Successfully executed.
//Try 2
New window: 29296288
Compiled succesfully in 562 ms.
SRL Compiled in 15 msec
Bowl identified in Column 0, Row 1.
Bowl identified in Column 1, Row 0.
Bowl identified in Column 2, Row 2.
Total time: 3978
Successfully executed.
//Try 3
New window: 3080600
Compiled succesfully in 561 ms.
SRL Compiled in 0 msec
Bowl is not visible in Column 0, Fixing that.
Bowl identified in Column 0, Row 0.
Bowl identified in Column 1, Row 1.
Bowl identified in Column 2, Row 2.
Total time: 5226
Successfully executed.
//Try 4
New window: 14747110
Compiled succesfully in 546 ms.
SRL Compiled in 16 msec
Bowl is not visible in Column 0, Fixing that.
Bowl identified in Column 0, Row 0.
Bowl identified in Column 1, Row 2.
Bowl is not visible in Column 2, Fixing that.
Bowl identified in Column 2, Row 0.
Total time: 8096
Successfully executed.
//Try 5
New window: 49153528
Compiled succesfully in 562 ms.
SRL Compiled in 15 msec
Bowl identified in Column 0, Row 1.
Bowl is not visible in Column 1, Fixing that.
Bowl identified in Column 1, Row 0.
Bowl identified in Column 2, Row 0.
Total time: 6849
Successfully executed.
//Try 6
New window: 28509554
Compiled succesfully in 546 ms.
SRL Compiled in 15 msec
Bowl is not visible in Column 0, Fixing that.
Bowl identified in Column 0, Row 0.
Bowl identified in Column 1, Row 0.
Bowl identified in Column 2, Row 1.
Total time: 7270
Successfully executed.
//Try 7
New window: 787916
Compiled succesfully in 546 ms.
SRL Compiled in 16 msec
Bowl identified in Column 0, Row 1.
Bowl is not visible in Column 1, Fixing that.
Bowl identified in Column 1, Row 0.
Bowl is not visible in Column 2, Fixing that.
Bowl identified in Column 2, Row 0.
Total time: 8471
Successfully executed.
//Try 8
New window: 5047390
Compiled succesfully in 562 ms.
SRL Compiled in 16 msec
Bowl is not visible in Column 0, Fixing that.
Bowl identified in Column 0, Row 0.
Bowl is not visible in Column 1, Fixing that.
Bowl identified in Column 1, Row 0.
Bowl is not visible in Column 2, Fixing that.
Bowl identified in Column 2, Row 0.
Total time: 10530
Successfully executed.
//Try 9
New window: 49481208
Compiled succesfully in 577 ms.
SRL Compiled in 16 msec
Bowl is not visible in Column 0, Fixing that.
Bowl identified in Column 0, Row 0.
Bowl identified in Column 1, Row 1.
Bowl identified in Column 2, Row 0.
Total time: 7769
Successfully executed.
//Try 10
New window: 4260598
Compiled succesfully in 546 ms.
SRL Compiled in 15 msec
Bowl identified in Column 0, Row 1.
Bowl is not visible in Column 1, Fixing that.
Bowl identified in Column 1, Row 0.
Bowl identified in Column 2, Row 0.
Total time: 7239
Successfully executed.
Tested with:
Simba Code:
program new;
{.include SRL/SRL.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '*****';
Pass := '******';
Active := True;
end;
end;
var
t: Integer;
begin
SetupSRL;
ActivateClient;
t := GetSystemTime;
arnav_FixLock;
Writeln('Total time: '+IntToStr(GetSystemTime - t));
end.
Successful solve report:
Progress Report by NCDS:
New window: 20186064
Compiled succesfully in 546 ms.
SRL Compiled in 0 msec
Bowl identified in Column 0, Row 2.
Bowl identified in Column 1, Row 1.
Bowl identified in Column 2, Row 0.
Successfully executed.
Tested with:
Simba Code:
program new;
{.include SRL/SRL.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '*****';
Pass := '******';
Active := True;
end;
end;
var
t: Integer;
begin
SetupSRL;
ActivateClient;
SolveArnav;
end.
New arnav_FixLock:
Simba Code:
function arnav_FixLock: Boolean;
var
t, Target, r, c, i, cts, L: Integer;
tpa: TPointArray;
aTPA: T2DPointArray;
col_Settings: TVariantArray;
b: TBox;
Col, InCol: array[0..2] of Boolean;
begin
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetArrayLength(aTPA, 2);
Result := False;
if (not arnav_LockScreen) then
Exit;
t := GetSystemTime;
FindColorsTolerance(tpa, 0, 7, 150, 80, 185, 1);
//WriteLn(inttostr(Length(tpa)));
case Length(tpa) of
116: Target := 3;//'ring';
84: Target := 0;//'bar';
108: Target := 1;//'bowl';
102: Target := 2;//'coins';
else
begin
WriteLn('Could not get Arnav target!');
Exit;
end;
end;
{Dark} {Bright}
col_Settings := [2, 2186858, 0.11, 0.30,{} 2, 4639204, 0.04, 2.01];
while (not Result) and ((GetSystemTime - t) < 15000) and arnav_LockScreen do
begin
for c := 0 to 2 do
begin
if Col[c] then
Continue;
for r := 0 to 2 do
begin
b := IntToBox(91 + (88 * c), 45 + (88 * r), 166 + (88 * c), 112 + (88 * r));
if (not InCol[c]) then
begin
for i := 0 to 1 do
begin
SetColorSpeed2Modifiers(col_Settings[3 * i + 3], col_Settings[3 * i + 4]);
FindColorsTolerance(aTPA[i], col_Settings[i * 4 + 1], b.x1, b.y1, b.x2, 288, col_Settings[i * 4]);
end;
L := Length(aTPA[0]) + Length(aTPA[1]);
//Writeln('Color count for Column['+IntToStr(c)+'] := '+IntToStr(L));
InCol[c] := (L > 40);
if (not InCol[c]) then
begin
Writeln('Bowl is not visible in Column '+IntToStr(c)+', Fixing that.');
arnav_ClickArrow(c, 1);
InCol[c] := True;
end;
end;
for i := 0 to 1 do
begin
SetColorSpeed2Modifiers(col_Settings[3 * i + 3], col_Settings[3 * i + 4]);
FindColorsTolerance(aTPA[i], col_Settings[i * 4 + 1], b.x1, b.y1, b.x2, b.y2, col_Settings[i * 4]);
end;
L := Length(aTPA[0]) + Length(aTPA[1]);
//Writeln('Col: '+IntToStr(c)+'; Row: '+IntToStr(r)+'; Color Count: '+IntToStr(L)+';');
if (L > 30) then
begin
Writeln('Bowl identified in Column '+IntToStr(c)+', Row '+IntToStr(r)+'.');
arnav_ClickArrow(c, Target - r);
Col[c] := True;
Break;
end;
end;
Result := Col[0] and Col[1] and Col[2];
end;
ColorToleranceSpeed(cts);
Wait(60);
end;
end;
I left my Dev'ing debug in there, just commented it so it's there for the future. I also added some debug so the user knows what's going on while it's solving. Feel free to remove whatever if you'd like though.
.Diff:
diff Code:
Index: capnarnav.scar
===================================================================
--- capnarnav.scar (revision 708)
+++ capnarnav.scar (working copy)
@@ -71,33 +71,39 @@
function arnav_FixLock: Boolean;
var
- t, Target, r, c: Integer;
+ t, Target, r, c, i, cts, L: Integer;
tpa: TPointArray;
+ aTPA: T2DPointArray;
+ col_Settings: TVariantArray;
b: TBox;
- Col: array[0..2] of Boolean;
+ Col, InCol: array[0..2] of Boolean;
begin
+ cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
+ SetArrayLength(aTPA, 2);
Result := False;
if (not arnav_LockScreen) then
Exit;
t := GetSystemTime;
FindColorsTolerance(tpa, 0, 7, 150, 80, 185, 1);
- WriteLn(inttostr(Length(tpa)));
+ //WriteLn(inttostr(Length(tpa)));
case Length(tpa) of
- 116: Target := 0;//'ring';
- 84: Target := 1;//'bar';
- 108: Target := 2;//'bowl';
- 102: Target := 3;//'coins'; 4.
- else
+ 116: Target := 3;//'ring';
+ 84: Target := 0;//'bar';
+ 108: Target := 1;//'bowl';
+ 102: Target := 2;//'coins';
+ else
begin
WriteLn('Could not get Arnav target!');
Exit;
end;
end;
+ {Dark} {Bright}
+ col_Settings := [2, 2186858, 0.11, 0.30,{} 2, 4639204, 0.04, 2.01];
- while (not Result) and ((GetSystemTime - t) < 30000) and arnav_LockScreen do
+ while (not Result) and ((GetSystemTime - t) < 15000) and arnav_LockScreen do
begin
for c := 0 to 2 do
begin
@@ -106,26 +112,41 @@
for r := 0 to 2 do
begin
b := IntToBox(91 + (88 * c), 45 + (88 * r), 166 + (88 * c), 112 + (88 * r));
- SetColorSpeed2Modifiers(0.02, 0.22);
- FindColorsTolerance(tpa, 1070710, b.x1, b.y1, b.x2, b.y2, 20);
- if (Length(tpa) > 400) then
+ if (not InCol[c]) then
begin
- arnav_ClickArrow(c, Target - r);
- Col[c] := True;
- Break;
+ for i := 0 to 1 do
+ begin
+ SetColorSpeed2Modifiers(col_Settings[3 * i + 3], col_Settings[3 * i + 4]);
+ FindColorsTolerance(aTPA[i], col_Settings[i * 4 + 1], b.x1, b.y1, b.x2, 288, col_Settings[i * 4]);
+ end;
+ L := Length(aTPA[0]) + Length(aTPA[1]);
+ //Writeln('Color count for Column['+IntToStr(c)+'] := '+IntToStr(L));
+ InCol[c] := (L > 40);
+ if (not InCol[c]) then
+ begin
+ Writeln('Bowl is not visible in Column '+IntToStr(c)+', Fixing that.');
+ arnav_ClickArrow(c, 1);
+ InCol[c] := True;
+ end;
end;
- SetColorSpeed2Modifiers(0.02, 0.05);
- FindColorsTolerance(tpa, 1624812, b.x1, b.y1, b.x2, b.y2, 20);
- if (Length(tpa) > 400) then
+ for i := 0 to 1 do
begin
- arnav_ClickArrow(c, Target - r - 1);
-
+ SetColorSpeed2Modifiers(col_Settings[3 * i + 3], col_Settings[3 * i + 4]);
+ FindColorsTolerance(aTPA[i], col_Settings[i * 4 + 1], b.x1, b.y1, b.x2, b.y2, col_Settings[i * 4]);
+ end;
+ L := Length(aTPA[0]) + Length(aTPA[1]);
+ //Writeln('Col: '+IntToStr(c)+'; Row: '+IntToStr(r)+'; Color Count: '+IntToStr(L)+';');
+ if (L > 30) then
+ begin
+ Writeln('Bowl identified in Column '+IntToStr(c)+', Row '+IntToStr(r)+'.');
+ arnav_ClickArrow(c, Target - r);
Col[c] := True;
Break;
end;
end;
+ Result := Col[0] and Col[1] and Col[2];
end;
- Result := Col[0] and Col[1] and Col[2];
+ ColorToleranceSpeed(cts);
Wait(60);
end;
end;
Like I mentioned above, I would love for someone else to test this, but I don't see anything going wrong.