Skip to content

Commit

Permalink
fix(fairy ring): now properly waits for the teleport to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Sep 5, 2024
1 parent 1e024f3 commit cf65b54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions optional/interfaces/mainscreen/fairyring.simba
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ begin
Exit;
pos := Self._Pos();
Mouse.Click(Self.GetTeleportButton(), MOUSE_LEFT);
Result := WaitUntil(not Self.IsOpen(), 300, 3000) and WaitUntil(pos.InRange(Self._Pos(), 24), 300, 3000);
Result := WaitUntil(not Self.IsOpen(), 300, 3000) and WaitUntil(not pos.InRange(Self._Pos(), 24), 300, 3000);
end;


Expand Down Expand Up @@ -1005,7 +1005,7 @@ begin

if contextMenuTeleport then
begin
Exit(WaitUntil(pos.InRange(Self._Pos(), 32), 300, 6000));
Exit(WaitUntil(not pos.InRange(Self._Pos(), 32), 300, 6000));
end;

if WaitUntil(Self.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000) then
Expand Down
21 changes: 9 additions & 12 deletions osr/interfaces/gametabs/achievements.simba
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ begin
buttons.Draw(bitmap);
end;

procedure TRSAchievements.MakeVisible(Diary : ERSAchievementDiary);
procedure TRSAchievements.MakeVisible(diary : ERSAchievementDiary);
var
CurrentScroll : Int32 := Self.GetScrollPosition;
Min, Max : Int32;
begin
Min := Ord(Diary) - 6;
Min := Ord(diary) - 6;
if Min < 0 then
Min := 0;
Min := Min * 20;

Max := Ord(Diary) * 20;
Max := Ord(diary) * 20;
if Max > 100 then
Max := 100;

Expand Down Expand Up @@ -210,7 +210,7 @@ begin
end;
end;

function TRSAchievements.GetDiaryBox(Diary : ERSAchievementDiary): TBox;
function TRSAchievements.GetDiaryBox(diary : ERSAchievementDiary): TBox;
const
EXPECTED_TEXT : TStringArray := ['Ardo', 'Dese', 'ador', 'Frem', 'Kand', 'Karam', 'Kour', 'Lumb', 'Mort', 'Varr', 'West', 'dern'];
var
Expand All @@ -219,7 +219,7 @@ var
i : Int32;
FoundText : String;
begin
Self.MakeVisible(Diary);
Self.MakeVisible(diary);
DiaryBoxes := Self.GetDiaryBoxes;
for i := 0 to High(DiaryBoxes) do
begin
Expand All @@ -231,14 +231,11 @@ begin
Result := [0, 0];
end;

function TRSAchievements.GetDiaryLevel(Diary : ERSAchievementDiary): Int32;
var
DiaryBox: TBox;
function TRSAchievements.GetDiaryLevel(diary : ERSAchievementDiary): Int32;
begin
Self.Open();
Self.OpenTab(ERSAChievementTab.DIARIES);
DiaryBox := Self.GetDiaryBox(Diary);
Result := Round(SRL.CountColor(CTS2(1357111, 1, 0.01, 0.01), DiaryBox) / 175);
if not Self.Open() then Exit(-1);
if not Self.OpenTab(ERSAChievementTab.DIARIES) then Exit(-1);
Result := Round(SRL.CountColor(CTS2(1357111, 1, 0.01, 0.01), Self.GetDiaryBox(diary)) / 175);
end;

var
Expand Down

0 comments on commit cf65b54

Please sign in to comment.