Skip to content

Commit 719a8c0

Browse files
committed
Cleanup for merge
1 parent c713523 commit 719a8c0

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

Form1.Designer.cs

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

Form1.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public Form1()
4747
{
4848
InitializeComponent();
4949
LoadData();
50+
botStatusLable.Text = "Bot Status: Stopped";
5051
string _token = discordTokenTB.Text;
5152
}
5253

@@ -702,6 +703,7 @@ private void stopbButton_Click(object sender, EventArgs e)
702703
{
703704
cancellationTokenSource.Cancel(); // Send the CancellationTokenSource
704705
UpdateLogger("Stopping Macro");
706+
705707
}
706708
}
707709

@@ -825,6 +827,16 @@ private async Task SendLiveButtonPress(string button)
825827

826828
private async void botStartBButton_Click(object sender, EventArgs e)
827829
{
830+
//disable subsequent button presses
831+
botStartBButton.Enabled = false;
832+
botStopBButton.BackColor = Color.RosyBrown;
833+
//prevent user from playing manual macro when bot is running
834+
playbButton.Enabled = false;
835+
livebButton.Enabled = false;
836+
837+
838+
botStatusLable.Text = "Bot Status: Running";
839+
//botStartBButton.Visible = true;
828840
SaveData();
829841
_bot?.StopAsync().Wait(); // Stop existing bot if any. Wait for completion.
830842

@@ -873,15 +885,20 @@ private async void botStartBButton_Click(object sender, EventArgs e)
873885
_bot = new DiscordBot(discordTokenTB.Text,userIds,channelIds,ipDict,macroDict); // Initialize a new instance
874886
_bot.LogAction = UpdateLogger;
875887
await _bot.MainAsync();
876-
botStartBButton.Enabled = false;
877-
botStartBButton.Visible = false;
888+
889+
878890
}
879891

880892
private async void botStopBButton_Click(object sender, EventArgs e)
881893
{
882-
await _bot?.StopAsync(); // Stop the bot if it exists
894+
//enable buttons after bot stop sent
883895
botStartBButton.Enabled = true;
884-
botStartBButton.Visible = true;
896+
botStatusLable.Text = "Bot Status: Stopped";
897+
botStopBButton.BackColor = Color.Transparent;
898+
playbButton.Enabled = true;
899+
livebButton.Enabled = true;
900+
await _bot?.StopAsync(); // Stop the bot if it exists
901+
885902
}
886903

887904
private void discordTokenTB_TextChanged(object sender, EventArgs e)

0 commit comments

Comments
 (0)