From a767699edca61d869310724abf6c671809ecf176 Mon Sep 17 00:00:00 2001 From: Torwent Date: Thu, 26 Dec 2024 02:17:04 +0100 Subject: [PATCH] fix(House): added a .Leave() method it uses biohash to decide if it will leave through options menu or the portal weighted towards the first. --- optional/handlers/house/house.simba | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/optional/handlers/house/house.simba b/optional/handlers/house/house.simba index c49a94e9..0aaab169 100644 --- a/optional/handlers/house/house.simba +++ b/optional/handlers/house/house.simba @@ -613,6 +613,22 @@ begin end; end; +function THouseHandler.Leave(): Boolean; +begin + if not Minimap.InPOH() then Exit(True); + + if Antiban.BioDice(0.95) then + begin + if not Options.LeaveHouse() then Exit; + end + else + begin + if not Self.Objects[EHouseObject.EXIT].WalkSelectOption(['Enter']) then Exit; + end; + + Result := WaitUntil(not Minimap.InPOH(), 300, 3000); +end; + function THouseHandler.CreateHouseTeleportCombobox(owner: TControl; topleft, offset: TPoint = [0,0]): TLabeledComboBox; type THouseHandler = THouseHandler; procedure THouseHandler.OnChange(sender: TObject);