-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.cs
77 lines (65 loc) · 1.98 KB
/
MainWindow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Threading;
using System.Windows.Forms;
using System.Drawing;
using System.Diagnostics;
namespace GTATools
{
public partial class MainWindow : Form
{
public static bool antiAfkEnabled = false;
Thread antiAfkThread = new Thread(new ThreadStart(antiAfk));
public MainWindow()
{
InitializeComponent();
// this.Cursor = new Cursor(Cursor.Current.Handle);
antiAfkThread.Start();
Console.WriteLine("Anti-AFK thread started.");
}
public static void antiAfk()
{
while (true)
{
if (antiAfkEnabled)
{
// TODO: Move mouse
MouseMovement.Move(-500, 0);
Thread.Sleep(1000);
MouseMovement.Move(500, 0);
}
Thread.Sleep(10000);
}
}
public static void makeSoloSession()
{
var GTAProcesses = Process.GetProcessesByName("GTA5");
var GTAProcess = new Process();
if(GTAProcesses.Length <= 0)
{
MessageBox.Show("GTA doesn't appear to be running!");
return;
}else
{
GTAProcess = GTAProcesses[0];
}
ProcessExtension.Suspend(GTAProcess);
Thread.Sleep(15000);
ProcessExtension.Resume(GTAProcess);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void antiAfkCheckbox_CheckedChanged(object sender, EventArgs e)
{
antiAfkEnabled = antiAfkCheckbox.Checked;
}
private void MainWindow_FormClosed(object sender, FormClosedEventArgs e)
{
antiAfkThread.Abort();
}
private void privateSessionBtn_Click(object sender, EventArgs e)
{
makeSoloSession();
}
}
}