Skip to content

Commit

Permalink
fix(walker): compatibility with latest SRL-T
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Feb 21, 2024
1 parent f972424 commit 0cc4082
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions osr/walker/objects/walkerobjects.simba
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function TRSWalker.Click(minimapPoint: TPoint; randomness: Int32): Boolean; over
var
p: TPoint;
hoveringTarget: Boolean;
msUpText, str: String;
upText: String;
begin
if MainScreen.IsUpText('>') and not TRSWalkerObject.CurrentUpText.Contains('Use') then
if MainScreen.IsUpText('>') and not TRSWalkerObject.CurrentUpText.ContainsAny(['Use', '>']) then
begin
ChooseOption.Select('Cancel');
Exit;
Expand All @@ -132,25 +132,12 @@ begin
begin
p := Minimap.RandomPointOnZoomRectangle(minimapPoint, randomness);
Mouse.Move(Minimap.PointToMsRect(p).Mean());
msUpText := MainScreen.GetUpText();

for str in TRSWalkerObject.CurrentUpText do
if str in msUpText then
begin
hoveringTarget := True;
Break;
end;
upText := MainScreen.GetUpText();

hoveringTarget := upText.ContainsAny(TRSWalkerObject.CurrentUpText);
if hoveringTarget and (TRSWalkerObject.CurrentActionUpText <> []) then
begin
hoveringTarget := False;
for str in TRSWalkerObject.CurrentActionUpText do
if str in msUpText then
begin
hoveringTarget := True;
Break;
end;

hoveringTarget := upText.ContainsAny(TRSWalkerObject.CurrentActionUpText);
if not hoveringTarget then
begin
TRSWalkerObject.RedClicked := ChooseOption.Select(TRSWalkerObject.CurrentActionUpText);
Expand All @@ -159,7 +146,7 @@ begin
Exit(TRSWalkerObject.RedClicked);
end;
end
else if not ('Walk here' in msUpText) then
else if not upText.ContainsAny(Self.WalkUpText) then
Exit(ChooseOption.Select('Walk here'));
end
else
Expand Down

0 comments on commit 0cc4082

Please sign in to comment.