ElderToad
ElderToad
CC#
Created by ElderToad on 8/6/2024 in #help
Towards the end of the bar being filled, I can click again. Does anyone know why?
c#
namespace FishingSharp
{
public partial class Main_Menu : Form
{
private System.Windows.Forms.Timer cooldownTimer;
private int cooldownDuration = 1000;
private int elapsedTime = 0;
private bool Fishing = false;

public Main_Menu()
{
InitializeComponent();
InitializeCooldownTimer();
}

private void InitializeCooldownTimer()
{
cooldownTimer = new System.Windows.Forms.Timer();
cooldownTimer.Interval = 20;
cooldownTimer.Tick += new EventHandler(CooldownTimer_Tick);
Cooldown.Maximum = cooldownDuration / cooldownTimer.Interval;
}

private void button1_Click(object sender, EventArgs e)
{
if (!Fishing)
{
elapsedTime = 0;
Cooldown.Value = 0;
Fishing = true;
cooldownTimer.Start();
}
}

private void CooldownTimer_Tick(object sender, EventArgs e)
{
elapsedTime += cooldownTimer.Interval ;
Cooldown.Value = elapsedTime / cooldownTimer.Interval;

if (elapsedTime >= cooldownDuration)
{
cooldownTimer.Stop();
Fishing = false;
Cooldown.Value = Cooldown.Maximum;
}
}
}
}
c#
namespace FishingSharp
{
public partial class Main_Menu : Form
{
private System.Windows.Forms.Timer cooldownTimer;
private int cooldownDuration = 1000;
private int elapsedTime = 0;
private bool Fishing = false;

public Main_Menu()
{
InitializeComponent();
InitializeCooldownTimer();
}

private void InitializeCooldownTimer()
{
cooldownTimer = new System.Windows.Forms.Timer();
cooldownTimer.Interval = 20;
cooldownTimer.Tick += new EventHandler(CooldownTimer_Tick);
Cooldown.Maximum = cooldownDuration / cooldownTimer.Interval;
}

private void button1_Click(object sender, EventArgs e)
{
if (!Fishing)
{
elapsedTime = 0;
Cooldown.Value = 0;
Fishing = true;
cooldownTimer.Start();
}
}

private void CooldownTimer_Tick(object sender, EventArgs e)
{
elapsedTime += cooldownTimer.Interval ;
Cooldown.Value = elapsedTime / cooldownTimer.Interval;

if (elapsedTime >= cooldownDuration)
{
cooldownTimer.Stop();
Fishing = false;
Cooldown.Value = Cooldown.Maximum;
}
}
}
}
2 replies
CC#
Created by ElderToad on 7/30/2024 in #help
My program gives my discord status a random ass image that I didn't assign lol
No description
2 replies
CC#
Created by ElderToad on 7/28/2024 in #help
How can I change the image in this area in a form?
No description
9 replies
CC#
Created by ElderToad on 7/25/2024 in #help
How can I make an application automatically start when my laptop starts?
I made a windows assistant with speech recognition, and I want to have the program start when my laptop does, so I don't have to restart the script every time my laptop restarts.
8 replies
CC#
Created by ElderToad on 7/24/2024 in #help
How can I open a program in a script?
I have this speech recognition thing that essentially acts as an assistant for my laptop, and I want to add commands that open different programs like spotify and steam. How can I do this?
7 replies