Skip to content

Commit 7bb2217

Browse files
authored
Merge pull request #51 from Erol444/hotfix_1.300.0
Hotfix 1.300.0
2 parents 74ec3e4 + 36d3bcc commit 7bb2217

File tree

8 files changed

+125
-36
lines changed

8 files changed

+125
-36
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
git branch --show-current
4141
last=$(git log --merges --grep='develop' --first-parent master --pretty=format:"%h" | sed -n '2p')
42-
changelog=$(git log --no-merges --pretty=format:'- %s' $last..HEAD)
42+
changelog=$(git log --no-merges --pretty=format:'- %s' $last..HEAD --reverse)
4343
changelog="${changelog//'%'/'%25'}"
4444
changelog="${changelog//$'\n'/'%0A'}"
4545
changelog="${changelog//$'\r'/'%0D'}"
@@ -130,7 +130,7 @@ jobs:
130130
nodetail: retrue
131131
description: |
132132
Version `TBS-${{needs.version.outputs.version}}`
133-
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{steps.tag.outputs.tag}}) to download!
133+
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download!
134134
**Changelog**:
135135
${{needs.version.outputs.changelog}}
136136
Clear:

TbsCore/Helpers/AccountHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static int Delay(Account acc)
5353
{
5454
//Return random delay
5555
Random rnd = new Random();
56-
return acc.Settings.DelayClicking + rnd.Next(-500, 500);
56+
return rnd.Next(acc.Settings.DelayClickingMin, acc.Settings.DelayClickingMax);
5757
}
5858

5959
public static void StartAccountTasks(Account acc)

TbsCore/Models/Settings/GeneralSettings.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public void Init()
2626
DonateAbove = 95;
2727
DonateExcessOf = 65;
2828
DiscordWebhook = false;
29-
DelayClicking = 3000;
29+
DelayClickingMin = 2500;
30+
DelayClickingMax = 3800;
3031
}
3132

3233
public bool AutoActivateProductionBoost { get; set; }
@@ -134,9 +135,14 @@ public void Init()
134135
public bool DiscordOnlineAnnouncement { get; set; }
135136

136137
/// <summary>
137-
/// How long should bot click between 2 click ( bot will +- 500ms for random )
138+
/// Minimum time between 2 click
138139
/// </summary>
139-
public int DelayClicking { get; set; }
140+
public int DelayClickingMin { get; set; }
141+
142+
/// <summary>
143+
/// Maximum time between 2 click
144+
/// </summary>
145+
public int DelayClickingMax { get; set; }
140146
}
141147

142148
/// <summary>

TravBotSharp/ControlPanel.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TravBotSharp/ControlPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private void button6_Click(object sender, EventArgs e) // Login all accounts
258258
if (acc.TaskTimer?.IsBotRunning() ?? false) continue;
259259

260260
_ = IoHelperCore.LoginAccount(acc);
261-
await Task.Delay(ran.Next(500, 5000));
261+
await Task.Delay(AccountHelper.Delay(acc));
262262
}
263263
}).Start();
264264
generalUc1.UpdateBotRunning("true");

TravBotSharp/Views/DebugUc.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ namespace TravBotSharp.Views
1111
public partial class DebugUc : TbsBaseUc, ITbsUc
1212
{
1313
public LogOutput Log;
14+
public bool active;
1415

1516
public DebugUc()
1617
{
1718
InitializeComponent();
19+
active = false;
1820
}
1921

2022
public void InitLog(LogOutput log)
@@ -25,13 +27,20 @@ public void InitLog(LogOutput log)
2527

2628
public void UpdateUc()
2729
{
30+
active = true;
2831
UpdateTaskTable();
2932
GetLogData();
3033
this.Focus();
3134
}
3235

36+
public void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
37+
{
38+
active = false;
39+
}
40+
3341
private void LogUpdate(object sender, UpdateLogEventArgs e)
3442
{
43+
if (!active) return;
3544
// only update current account
3645
if (e.Username == GetSelectedAcc().AccInfo.Nickname)
3746
{
@@ -41,6 +50,8 @@ private void LogUpdate(object sender, UpdateLogEventArgs e)
4150

4251
public void GetLogData()
4352
{
53+
if (!active) return;
54+
4455
if (logTextBox.InvokeRequired)
4556
{
4657
logTextBox.BeginInvoke(new Action(delegate
@@ -56,6 +67,7 @@ public void GetLogData()
5667

5768
public void UpdateLogData()
5869
{
70+
if (!active) return;
5971
if (logTextBox.InvokeRequired)
6072
{
6173
logTextBox.BeginInvoke(new Action(delegate
@@ -65,11 +77,12 @@ public void UpdateLogData()
6577
return;
6678
}
6779
var acc = GetSelectedAcc();
68-
logTextBox.Text = $"{Log.GetLog(acc.AccInfo.Nickname)}{logTextBox.Text}";
80+
logTextBox.Text = $"{Log.GetLastLog(acc.AccInfo.Nickname)}{logTextBox.Text}";
6981
}
7082

7183
public void UpdateTaskTable()
7284
{
85+
if (!active) return;
7386
if (taskListView.InvokeRequired)
7487
{
7588
taskListView.BeginInvoke(new Action(delegate

TravBotSharp/Views/GeneralUc.Designer.cs

Lines changed: 89 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TravBotSharp/Views/GeneralUc.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public void UpdateUc()
6464
UpdaterBonusPrio(acc);
6565
UpdaterResPrio(acc);
6666

67-
clickDelayUpDown.Value = acc.Settings.DelayClicking;
67+
clickDelayMin.Value = acc.Settings.DelayClickingMin > 0 ? acc.Settings.DelayClickingMin : 2500;
68+
clickDelayMax.Value = acc.Settings.DelayClickingMax > 0 ? acc.Settings.DelayClickingMax : 3800;
6869
}
6970

7071
private void SupplyResourcesButton_Click(object sender, EventArgs e) //select village to supply res to new villages
@@ -417,7 +418,12 @@ private void button12_Click(object sender, EventArgs e)
417418

418419
private void clickDelayUpDown_ValueChanged(object sender, EventArgs e)
419420
{
420-
GetSelectedAcc().Settings.DelayClicking = (int)clickDelayUpDown.Value;
421+
GetSelectedAcc().Settings.DelayClickingMin = (int)clickDelayMin.Value;
422+
}
423+
424+
private void clickDelayMax_ValueChanged(object sender, EventArgs e)
425+
{
426+
GetSelectedAcc().Settings.DelayClickingMax = (int)clickDelayMax.Value;
421427
}
422428

423429
private void UpdaterResPrio(Account acc)

0 commit comments

Comments
 (0)