Skip to content

Commit 91753b5

Browse files
committed
disable revive hero
1 parent 7920808 commit 91753b5

File tree

2 files changed

+37
-33
lines changed

2 files changed

+37
-33
lines changed

TbsCore/Tasks/Others/ReviveHero.cs

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,44 @@ public class ReviveHero : BotTask
1010
{
1111
public override async Task<TaskRes> Execute(Account acc)
1212
{
13-
StopFlag = false;
14-
acc.Logger.Information("Navigate to revive page", this);
15-
await NavigationHelper.ToHero(acc, NavigationHelper.HeroTab.Attributes);
16-
if (StopFlag) return TaskRes.Executed;
13+
await Task.Yield();
14+
acc.Logger.Warning("This feature is temporary disabled");
15+
return TaskRes.Executed;
1716

18-
acc.Logger.Information("Find revive button to click", this);
19-
//heroRegeneration
20-
var reviveButton = acc.Wb.Html.GetElementbyId("heroRegeneration");
21-
if (reviveButton == null)
22-
{
23-
acc.Logger.Information("No revive button found!");
24-
return TaskRes.Executed;
25-
}
17+
//StopFlag = false;
18+
//acc.Logger.Information("Navigate to revive page", this);
19+
//await NavigationHelper.ToHero(acc, NavigationHelper.HeroTab.Attributes);
20+
//if (StopFlag) return TaskRes.Executed;
2621

27-
if (reviveButton.HasClass("green"))
28-
{
29-
var element = acc.Wb.Driver.FindElement(By.XPath(reviveButton.XPath));
22+
//acc.Logger.Information("Find revive button to click", this);
23+
////heroRegeneration
24+
//var reviveButton = acc.Wb.Html.GetElementbyId("heroRegeneration");
25+
//if (reviveButton == null)
26+
//{
27+
// acc.Logger.Information("No revive button found!");
28+
// return TaskRes.Executed;
29+
//}
3030

31-
if (element == null)
32-
{
33-
acc.Logger.Information("Cannot click revive button!");
34-
return TaskRes.Executed;
35-
}
31+
//if (reviveButton.HasClass("green"))
32+
//{
33+
// var element = acc.Wb.Driver.FindElement(By.XPath(reviveButton.XPath));
3634

37-
element.Click();
38-
return TaskRes.Executed;
39-
}
40-
else
41-
{
42-
//no resources?
43-
acc.Logger.Information("Don't have enough resource. Retry after 10 minutes!");
44-
NextExecute = DateTime.Now.AddMinutes(10);
45-
return TaskRes.Executed;
46-
}
35+
// if (element == null)
36+
// {
37+
// acc.Logger.Information("Cannot click revive button!");
38+
// return TaskRes.Executed;
39+
// }
40+
41+
// element.Click();
42+
// return TaskRes.Executed;
43+
//}
44+
//else
45+
//{
46+
// //no resources?
47+
// acc.Logger.Information("Don't have enough resource. Retry after 10 minutes!");
48+
// NextExecute = DateTime.Now.AddMinutes(10);
49+
// return TaskRes.Executed;
50+
//}
4751
}
4852
}
4953
}

TbsCore/Tasks/Others/SellOnAuctions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ public class SellOnAuctions : BotTask
1414
private readonly Random rand = new Random();
1515

1616
public override async Task<TaskRes> Execute(Account acc)
17-
1817
{
18+
await Task.Yield();
19+
acc.Logger.Warning("This feature is temporary disabled");
20+
return TaskRes.Executed;
1921
//if (!acc.Wb.CurrentUrl.Contains("auction?action=sell"))
2022
//{
2123
// string xPathSellTab = null;
@@ -112,8 +114,6 @@ public override async Task<TaskRes> Execute(Account acc)
112114
// }
113115
// while (counter > 0);
114116
//}
115-
116-
return TaskRes.Executed;
117117
}
118118
}
119119
}

0 commit comments

Comments
 (0)