Skip to content

Commit

Permalink
Added option for Azerty Layour
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Tuncay committed Apr 5, 2023
1 parent 3a84122 commit bfc14be
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 21 deletions.
27 changes: 19 additions & 8 deletions Form.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 70 additions & 13 deletions Form.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Rebar;

namespace AFK_Assist
{
Expand Down Expand Up @@ -82,7 +76,7 @@ private void ButtonStop_Click(object sender, EventArgs e)
SetTimerInterval(1);

int minutes = (int)Stopwatch.Elapsed.TotalMinutes;
int seconds = (int)(Stopwatch.Elapsed.TotalSeconds - (minutes * 60));
int seconds = (int)(Stopwatch.Elapsed.TotalSeconds - (minutes * 60));
MessageBox.Show("Elapsed Time " + minutes.ToString("00") + ":" + seconds.ToString("00"), "Stopped");
}
#endregion
Expand Down Expand Up @@ -117,12 +111,26 @@ private void Timer_TickAsync(object sender, EventArgs e)
int randInt = Random.Next(4);
if (randInt == 0 && WKeyPressed == false)
{
WKey();
if (AzertyToolStripMenuItem.Checked)
{
ZKey();
}
else
{
WKey();
}
WKeyPressed = true;
}
else if (randInt == 1 && AKeyPressed == false)
{
AKey();
if (AzertyToolStripMenuItem.Checked)
{
ZKey();
}
else
{
AKey();
}
AKeyPressed = true;
}
else if (randInt == 2 && SKeyPressed == false)
Expand All @@ -146,14 +154,47 @@ private void Timer_TickAsync(object sender, EventArgs e)
}
else
{
WKey();
AKey();
if (AzertyToolStripMenuItem.Checked)
{
ZKey();
QKey();
}
else
{
WKey();
AKey();
}
SKey();
DKey();

}

// Keyboard Presses
void ZKey()
{
// Keyboard Key Z
if (WKeyCheckBox.Checked)
{
keybd_event((byte)Keys.Z, 0x45, KEYEVENTF_EXTENDEDKEY, 0); // Press Z key
Thread.Sleep(800);
keybd_event((byte)Keys.Z, 0x45, KEYEVENTF_KEYUP, 0); // Release Z key

// Update Log
UpdateLog("* Z Key");
}
}
void QKey()
{
// Keyboard Key A
if (AKeyCheckBox.Checked)
{
keybd_event((byte)Keys.Q, 0x45, KEYEVENTF_EXTENDEDKEY, 0); // Press Q key
Thread.Sleep(800);
keybd_event((byte)Keys.Q, 0x45, KEYEVENTF_KEYUP, 0); // Release Q key

// Update Log
UpdateLog("* Q Key");
}
}
void WKey()
{
// Keyboard Key W
Expand Down Expand Up @@ -227,7 +268,7 @@ void DKey()
UpdateLog("* Right mouse");
}

LoopNumber ++;
LoopNumber++;

// Update Log
UpdateLog($"Finished Loop {LoopNumber}\n\r");
Expand Down Expand Up @@ -389,10 +430,13 @@ private void ClearToolStripMenuItem_Click(object sender, EventArgs e)
// Disable Checkboxes
AltTabToolStripMenuItem.Checked = false;
RandomizeToolStripMenuItem.Checked = false;
AzertyToolStripMenuItem.Checked = false;

MouseCheckBox.Checked = false;
MouseClickLeftCheckBox.Checked = false;
MouseClickRightCheckBox.Checked = false;
KeyboardCheckBox.Checked = false;

WKeyCheckBox.Checked = false;
AKeyCheckBox.Checked = false;
SKeyCheckBox.Checked = false;
Expand Down Expand Up @@ -450,6 +494,19 @@ private void RocketLeagueToolStripMenuItem_Click(object sender, EventArgs e)
MousePanel.Visible = false;
KeyboardPanel.Visible = false;
}
private void AzertyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (AzertyToolStripMenuItem.Checked)
{
WKeyCheckBox.Text = "Z Key";
AKeyCheckBox.Text = "Q Key";
}
else
{
WKeyCheckBox.Text = "W Key";
AKeyCheckBox.Text = "A Key";
}
}
#endregion

#region TrackBar
Expand Down

0 comments on commit bfc14be

Please sign in to comment.