Skip to content

Commit eb3b40f

Browse files
committed
Handle video capture in lair bot differently
1 parent b737da2 commit eb3b40f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

SysBot.Pokemon/SWSH/BotEncounter/EncounterBot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public override async Task HardStop()
6767
protected abstract Task EncounterLoop(SAV8SWSH sav, CancellationToken token);
6868

6969
// return true if breaking loop
70-
protected async Task<bool> HandleEncounter(PK8? pk, CancellationToken token)
70+
protected async Task<bool> HandleEncounter(PK8? pk, CancellationToken token, bool isLair = false)
7171
{
7272
if (pk == null)
7373
return false;
@@ -89,7 +89,7 @@ protected async Task<bool> HandleEncounter(PK8? pk, CancellationToken token)
8989
if (!StopConditionSettings.EncounterFound(pk, DesiredMinIVs, DesiredMaxIVs, Hub.Config.StopConditions, WantedNatures, UnwantedMarks))
9090
return false;
9191

92-
if (Hub.Config.StopConditions.CaptureVideoClip)
92+
if (Hub.Config.StopConditions.CaptureVideoClip && !isLair)
9393
{
9494
await Task.Delay(Hub.Config.StopConditions.ExtraTimeWaitCaptureVideo, token).ConfigureAwait(false);
9595
await PressAndHold(CAPTURE, 2_000, 0, token).ConfigureAwait(false);

SysBot.Pokemon/SWSH/BotEncounter/EncounterBotLair.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ protected override async Task EncounterLoop(SAV8SWSH sav, CancellationToken toke
4545
private async Task InnerLoop(CancellationToken token)
4646
{
4747
var target = Settings.MaxLairSettings.EditLairPath;
48-
var wasVideoClipActive = Hub.Config.StopConditions.CaptureVideoClip;
4948
Stopwatch stopwatch = new();
5049
bool caneditspecies = true;
5150
uint pathoffset = LairSpeciesSelector;
@@ -89,10 +88,6 @@ private async Task InnerLoop(CancellationToken token)
8988

9089
while (!token.IsCancellationRequested)
9190
{
92-
//Capture video clip is menaged internally
93-
if (wasVideoClipActive)
94-
Hub.Config.StopConditions.CaptureVideoClip = false;
95-
9691
//Talk to the Lady
9792
while (!await IsInLairWait(token).ConfigureAwait(false))
9893
await Click(A, 0_500, token).ConfigureAwait(false);
@@ -183,11 +178,8 @@ private async Task InnerLoop(CancellationToken token)
183178
await Click(A, 0_900, token).ConfigureAwait(false);
184179
await Click(DDOWN, 0_800, token).ConfigureAwait(false);
185180
await Click(A, 2_300, token).ConfigureAwait(false);
186-
if (wasVideoClipActive == true)
187-
{
181+
if (Hub.Config.StopConditions.CaptureVideoClip == true)
188182
await PressAndHold(CAPTURE, 2_000, 10_000, token).ConfigureAwait(false);
189-
Hub.Config.StopConditions.CaptureVideoClip = true;
190-
}
191183

192184
if (pk != null && found[2] == 1)
193185
{
@@ -243,7 +235,7 @@ private async Task<int[]> IsAdventureHuntFound(CancellationToken token)
243235
found[1] = 1;
244236
}
245237

246-
if(await HandleEncounter(pkm, token).ConfigureAwait(false))
238+
if(await HandleEncounter(pkm, token, true).ConfigureAwait(false))
247239
{
248240
found[0] = i + 1;
249241
enc_conditions = true;

0 commit comments

Comments
 (0)