Skip to content

Commit 0c1cbbe

Browse files
committed
Fix:
- Farmlists not sending at low delays - NPC not happening due to bot already being in the market
1 parent e114b5f commit 0c1cbbe

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

TbsCore/Core/PostLoadHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public static List<Action> GetPostLoadTasks(Account acc)
179179
acc.Tasks.Add(new NPC()
180180
{
181181
ExecuteAt = DateTime.MinValue,
182-
Vill = vill
182+
Vill = vill,
183+
Priority = TaskPriority.High
183184
}, true, vill);
184185
}
185186
},

TbsCore/Tasks/LowLevel/NPC.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class NPC : BotTask
1212
{
1313
public override async Task<TaskRes> Execute(Account acc)
1414
{
15-
if (!await VillageHelper.EnterBuilding(acc, Vill, Classificator.BuildingEnum.Marketplace, "&t=0"))
15+
if (!await VillageHelper.EnterBuilding(acc, Vill, Classificator.BuildingEnum.Marketplace, "&t=0", update: true))
1616
return TaskRes.Executed;
1717

1818
var npcMerchant = acc.Wb.Html.DocumentNode.Descendants("div").FirstOrDefault(x => x.HasClass("npcMerchant"));

TbsCore/Tasks/LowLevel/SendFarmlist.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public override async Task<TaskRes> Execute(Account acc)
4646
flNode.Descendants("div").Any(x => x.HasClass("expandCollapse") && x.HasClass("collapsed")))
4747
{
4848
await DriverHelper.ExecuteScript(acc, $"Travian.Game.RaidList.toggleList({this.FL.Id});");
49+
await Task.Delay(500);
50+
acc.Wb.UpdateHtml();
4951
// Update flNode!
5052
flNode = GetFlNode(acc.Wb.Html, acc.AccInfo.ServerVersion);
5153
}

0 commit comments

Comments
 (0)