Skip to content

Commit

Permalink
fix(fishing handler): minor logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Aug 12, 2024
1 parent 4441133 commit aeb5899
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions optional/handlers/rsfishinghandler.simba
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ end;
```pascal
procedure TRSFishingHandler.Reset();
```
Resets TRSFishingHandler to the non fishing state.
This will:
- Pause TRSFishingHandler.Timer;
Expand All @@ -180,7 +179,6 @@ end;
```pascal
function TRSFishingHandler.GetMMShoreLine(): TPointArray;
```
Get the shore lines on the minimap.
Example:
Expand Down Expand Up @@ -212,7 +210,6 @@ end;
```pascal
function TRSFishingHandler.GetMSShoreLine(): TPointArray;
```
Get the shore lines on the mainscreen.
Example:
Expand Down Expand Up @@ -244,7 +241,6 @@ end;
```pascal
function TRSFishingHandler.FindWaterDirection(): TRectangle;
```
Finds the adjacent tile that is directly close to the player that has water.
Example:
Expand Down Expand Up @@ -280,11 +276,8 @@ end;
## TRSFishingHandler.FindSpot
```pascal
function TRSFishingHandler.FindSpot(out atpa: T2DPointArray; waitTime: Int32 = 350): Boolean;
```
```pascal
function TRSFishingHandler.FindSpot(): Boolean; overload;
```
Find fishing spots on the mainscreen. Optionally return at ATPA of the found spots.
Example:
Expand Down Expand Up @@ -363,11 +356,8 @@ end;
## TRSFishingHandler.WaitSpot
```pascal
function TRSFishingHandler.WaitSpot(out atpa: T2DPointArray; waitTime: Int32 = 350): Boolean;
```
```pascal
function TRSFishingHandler.WaitSpot(): Boolean; overload;
```
Wait for fishing spots on the mainscreen. Optionally return at ATPA of the found spots.
Example:
Expand All @@ -393,6 +383,8 @@ function TRSFishingHandler.WaitSpot(out atpa: T2DPointArray; waitTime: Int32 = 3
t := GetTickCount() + waitTime;

repeat
if Inventory.IsFull() then Exit;

for c in Self.FishSpotColors do
if SRL.FindColors(tpa, c, bounds) then
spotTPA += tpa;
Expand Down Expand Up @@ -450,11 +442,8 @@ end;
## TRSFishingHandler.SpotMoved
```pascal
function TRSFishingHandler.SpotMoved(out atpa: T2DPointArray): Boolean;
```
```pascal
function TRSFishingHandler.SpotMoved(): Boolean; overload;
```
Check if TRSFishingHandler.CurrentSpot moved.
Example:
Expand Down Expand Up @@ -525,7 +514,6 @@ end;
```pascal
function TRSFishingHandler._StoppedFishing(): Boolean;
```
Internal helper method to check for quick things that guarantee us we are not fishing anymore.
*)
function TRSFishingHandler._StoppedFishing(): Boolean;
Expand All @@ -539,11 +527,8 @@ end;
## TRSFishingHandler.CheckFishing
```pascal
function TRSFishingHandler.CheckFishing(out atpa: T2DPointArray): Boolean;
```
```pascal
function TRSFishingHandler.CheckFishing(): Boolean; overload;
```
Check if we are still fishing. This function could give false positives but it's extremely unlikely.
To determine if we are still fishing it does the following:
- Check if TRSFishingHandler.CurrentSpot (which is the last spot we clicked) has moved.
Expand Down Expand Up @@ -598,7 +583,6 @@ end;
```pascal
function TRSFishingHandler.FacingWater(): Boolean;
```
Check if we have water directly north, west, south or east of us.
Example:
Expand All @@ -624,7 +608,6 @@ end;
function TRSFishingHandler.ClickSpot(out atpa: T2DPointArray): Boolean;
function TRSFishingHandler.ClickSpot(): Boolean; overload;
```
Click the closest fishing spot to the player and switches TRSFishingHandler to "IsFishing".
We can check if we are still fishing with TRSFishingHandler.CheckFishing().
Expand Down

0 comments on commit aeb5899

Please sign in to comment.