Skip to content

Commit a464ddf

Browse files
committed
fix: several small fixes to antiban and graphgen
1 parent 7675490 commit a464ddf

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

osrs/antiban/antibanform.simba

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,10 @@ begin
787787

788788

789789
Self.TaskVariationSpinner := TLazFloatSpinEdit.CreateEx(lPanel, '', 'Edit the currently selected task interval variation.');
790-
Self.TaskVariationSpinner.Text := '3.3';
790+
Self.TaskVariationSpinner.Value := 0.33;
791+
Self.TaskVariationSpinner.MinValue := 0;
792+
Self.TaskVariationSpinner.MaxValue := 1;
793+
Self.TaskVariationSpinner.Increment := 0.05;
791794
Self.TaskVariationSpinner.Align := ELazAlign.Top;
792795
Self.TaskVariationSpinner.BorderSpacing.Left := 10;
793796
Self.TaskVariationSpinner.BorderSpacing.Right := 10;
@@ -909,7 +912,7 @@ begin
909912
Self.BreakLogoutSpinner.MinValue := 0.00;
910913
Self.BreakLogoutSpinner.MaxValue := 1.00;
911914
Self.BreakLogoutSpinner.Increment := 0.10;
912-
Self.BreakLogoutSpinner.Text := '0.05';
915+
Self.BreakLogoutSpinner.Value := 0.05;
913916
Self.BreakLogoutSpinner.Align := ELazAlign.Top;
914917
Self.BreakLogoutSpinner.BorderSpacing.Left := 10;
915918
Self.BreakLogoutSpinner.BorderSpacing.Right := 10;
@@ -922,7 +925,10 @@ begin
922925
lbl.BorderSpacing.Right := 10;
923926

924927
Self.BreakVariationSpinner := TLazFloatSpinEdit.CreateEx(lPanel);
925-
Self.BreakVariationSpinner.Text := '3.3';
928+
Self.BreakVariationSpinner.Value := 0.33;
929+
Self.BreakVariationSpinner.MinValue := 0;
930+
Self.BreakVariationSpinner.MaxValue := 1;
931+
Self.BreakVariationSpinner.Increment := 0.05;
926932
Self.BreakVariationSpinner.Align := ELazAlign.Top;
927933
Self.BreakVariationSpinner.BorderSpacing.Left := 10;
928934
Self.BreakVariationSpinner.BorderSpacing.Right := 10;

utils/webgraphgen.simba

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ begin
361361
end;
362362
end;
363363

364-
function TWebGraphGenerator.ConnectLastDoors(out graph: TWebGraph; idx, door: Integer; constref tree: TKDPointTree): TGraphNodeArray;
364+
procedure TWebGraphGenerator.ConnectLastDoors(out graph: TWebGraph; idx, door: Integer; constref tree: TKDPointTree);
365365
var
366366
p, q: TPoint;
367367
i, j: Integer;
@@ -510,36 +510,35 @@ var
510510
i, j: Integer;
511511
t: UInt64;
512512
begin
513-
white := map.FindColor($FFFFFF, 0);
514-
red := map.FindColor($0000FF, 0);
515-
516-
WriteLn GetDebugLn('Generating webgraph for region: ' + name);
517-
513+
WriteLn GetDebugLn('Generating webgraph for region: ' + name + ' this can take a few seconds.');
518514
t := GetTimeRunning();
519-
Result := Self._BuildGraph(map, white, red);
520515

516+
white := map.FindColor($FFFFFF, 0);
517+
red := map.FindColor($0000FF, 0);
521518
gray := map.FindColor($333333, 0);
522519

520+
Result := Self._BuildGraph(map, white, red);
523521
grayClusters := gray.Cluster(1);
524522

525523
for i := 0 to High(Self.WhiteClusters) do
526524
begin
527-
if Length(Self.WhiteClusters[i]) <= 6 then Continue;
525+
if Length(Self.WhiteClusters[i]) <= 6 then
526+
Continue;
528527

529528
graySubset := gray.ExtractBox(Self.WhiteClusters[i].Bounds().Expand(80));
530529
merged := Self.WhiteClusters[i] + graySubset;
531530
mergedClusters := merged.Cluster(1);
532531

533-
for j := 0 to high(mergedClusters) do
532+
for j := 0 to High(mergedClusters) do
534533
if mergedClusters[j].Contains(Self.WhiteClusters[i][0]) then
535534
begin
536535
Result.WalkableClusters += mergedClusters[j];
537536
Break;
538537
end;
539538
end;
540539

541-
Result.WalkableSpace := white + gray;
542-
Result.ObjectClusters := grayClusters;
540+
Result.WalkableSpace := white + gray;
541+
Result.ObjectClusters := grayClusters;
543542

544543
Self.WhiteClusters := [];
545544
WriteLn GetDebugLn('WebGraphGenerator', 'Generating webgraph took ' + ToStr(Round(((GetTimeRunning()-t)/1000), 2)) + ' seconds.', ELogLevel.SUCCESS);

0 commit comments

Comments
 (0)