Skip to content

Commit

Permalink
Merge branch 'Skua' of https://github.com/BrenoHenrike/Scripts into Skua
Browse files Browse the repository at this point in the history
  • Loading branch information
wtffidy committed Nov 6, 2024
2 parents aa3d8f3 + b668847 commit ee657ba
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
46 changes: 33 additions & 13 deletions CoreBots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4784,16 +4784,29 @@ public void JumpWait()

ToggleAggro(false);

(string?, string) cellPad = (null, "Left");
(string, string) cellPad = (string.Empty, "Left");
int jumpCount = 1;

if (!blackListedCells.Contains("Enter"))
{
cellPad =
// Set Cell:
(Bot.Map.Cells.Any(x => x.Contains("Enter")) ? "Enter" : Bot.Map.Cells.FirstOrDefault(x => !x.StartsWith("Wait") || !x.StartsWith("Blank")),
// Set Pad:
Bot.Map.Cells.Any(x => x.Contains("Enter")) ? "Spawn" : "Left");
string? cell = null;
for (int i = 0; i < 5; i++)
{
cell = Bot.Map.Cells.FirstOrDefault(x => x.Contains("Enter")) ??
Bot.Map.Cells.FirstOrDefault(x => !x.StartsWith("Wait") && !x.StartsWith("Blank"));
if (cell != null)
break;
Logger($"Attempt {i + 1}: Suitable cell not found. Retrying...");
Sleep(1000); // Wait for 1 second before retrying
}

if (cell == null)
{
Logger("Suitable cell not found after 5 attempts.");
return;
}

cellPad = (cell, Bot.Map.Cells.Any(x => x.Contains("Enter")) ? "Spawn" : "Left");
}
else
{
Expand Down Expand Up @@ -4869,16 +4882,23 @@ public void JumpWait()

if (lastMapJW != Bot.Map.Name || lastCellPadJW != cellPad)
{
for (int i = 0; i < jumpCount; i++)
if (!string.IsNullOrEmpty(cellPad.Item1) && !string.IsNullOrEmpty(cellPad.Item2))
{
Jump(cellPad!.Item1, cellPad.Item2, true);
Bot.Wait.ForTrue(() => Bot.Player.Cell == cellPad!.Item1, 20);
}
for (int i = 0; i < jumpCount; i++)
{
Jump(cellPad.Item1, cellPad.Item2, true);
Bot.Wait.ForTrue(() => Bot.Player.Cell == cellPad.Item1, 20);
}

lastMapJW = Bot.Map.Name;
lastCellPadJW = cellPad!;
lastMapJW = Bot.Map.Name;
lastCellPadJW = cellPad;

Sleep(ExitCombatDelay < 200 ? ExitCombatDelay : ExitCombatDelay - 200);
Sleep(ExitCombatDelay < 200 ? ExitCombatDelay : ExitCombatDelay - 200);
}
else
{
Logger("cellPad is null. Cannot perform jump.");
}
}
GC.Collect();
}
Expand Down
6 changes: 3 additions & 3 deletions scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"null"
],
"path": "CoreBots.cs",
"size": 280157,
"size": 280869,
"fileName": "CoreBots.cs",
"downloadUrl": "https://raw.githubusercontent.com/BrenoHenrike/Scripts/Skua/CoreBots.cs"
},
Expand Down Expand Up @@ -664,7 +664,7 @@
"nythera"
],
"path": "Story/NytheraSaga.cs",
"size": 3997,
"size": 3959,
"fileName": "NytheraSaga.cs",
"downloadUrl": "https://raw.githubusercontent.com/BrenoHenrike/Scripts/Skua/Story/NytheraSaga.cs"
},
Expand Down Expand Up @@ -14629,7 +14629,7 @@
"class"
],
"path": "Other/Classes/VerusDoomKnight.cs",
"size": 14093,
"size": 14239,
"fileName": "VerusDoomKnight.cs",
"downloadUrl": "https://raw.githubusercontent.com/BrenoHenrike/Scripts/Skua/Other/Classes/VerusDoomKnight.cs"
},
Expand Down

0 comments on commit ee657ba

Please sign in to comment.