From eb7ecbdbcdefda6d37a622d4ea0252fd90b8e1f2 Mon Sep 17 00:00:00 2001 From: Aleksander Evensen Date: Wed, 4 Dec 2019 21:53:56 +0100 Subject: [PATCH] Fixed Solo public lobby Solo public lobby generator fixed changed hotkeys --- GTATool/GTATool.csproj | 4 ++-- GTATool/MainWindow.Designer.cs | 2 +- GTATool/MainWindow.cs | 41 ++++++++++++++++++++++++---------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/GTATool/GTATool.csproj b/GTATool/GTATool.csproj index eb1a5bb..025ee44 100644 --- a/GTATool/GTATool.csproj +++ b/GTATool/GTATool.csproj @@ -37,7 +37,7 @@ ..\packages\GlobalHotKey.1.1.0\lib\GlobalHotKey.dll - ./DLLs/SimpleUI.dll + DLLs\SimpleUI.dll @@ -107,4 +107,4 @@ - + \ No newline at end of file diff --git a/GTATool/MainWindow.Designer.cs b/GTATool/MainWindow.Designer.cs index 60cf3ff..42ef943 100644 --- a/GTATool/MainWindow.Designer.cs +++ b/GTATool/MainWindow.Designer.cs @@ -70,7 +70,7 @@ private void InitializeComponent() { this.formSkin1.Name = "formSkin1"; this.formSkin1.Size = new System.Drawing.Size(646, 395); this.formSkin1.TabIndex = 14; - this.formSkin1.Text = "formSkin1"; + this.formSkin1.Text = "Multitool for GTA"; // // btnMin // diff --git a/GTATool/MainWindow.cs b/GTATool/MainWindow.cs index 0092fdd..3a44a1b 100644 --- a/GTATool/MainWindow.cs +++ b/GTATool/MainWindow.cs @@ -77,7 +77,12 @@ private void btnMin_Click(object sender, EventArgs e) bool isAntiAFKRunning = false; // mouse thread Thread MouseThread; + // Solo public thread + Thread SoloPublicThread; + //The gta process + Process GTAProcess; + public MainWindow() { @@ -100,6 +105,7 @@ public MainWindow() { // This initialize a thread that is moving to mouse cursor(Used in ANTI-AFK) MouseThread = new Thread(new ThreadStart(MouseThreadFunction)); + SoloPublicThread = new Thread(new ThreadStart(SoloPublicThreadMethod)); } @@ -237,7 +243,7 @@ public void ResumeProcess(Process process) { public void StartSoloPublic() { // Get the gta process - Process GTAProcess = GetProcessStatus(); + GTAProcess = GetProcessStatus(); // if process is found do the code in between the blocks @@ -245,17 +251,11 @@ public void StartSoloPublic() { isStartingSoloPublic = true; WriteLine("Creating Solo Public Session. This takes 10.5 seconds"); - - // Suspend the gta process - SuspendProcess(GTAProcess); + WriteLine("You will be in the solopublic lobby after the freeze"); + SoloPublicThread.Start(); + SoloPublicThread = new Thread(new ThreadStart(SoloPublicThreadMethod)); - // Wait for 10,5 seconds - Thread.Sleep(10500); - - // Resume the process - ResumeProcess(GTAProcess); - // Write a sucess message to console - WriteLine("Solo Public created"); + isStartingSoloPublic = false; @@ -284,6 +284,21 @@ private Process GetProcessStatus() { return null; } } + + public void SoloPublicThreadMethod() { + + // Suspend the gta process + SuspendProcess(GTAProcess); + + // Wait for 10,5 seconds + Thread.Sleep(10500); + + // Resume the process + ResumeProcess(GTAProcess); + } + + + #endregion @@ -308,6 +323,8 @@ public void ToggleAfk() { } } + + // this method is the loop for the Anti-AFK program // it will only move the cursor to the right public void MouseThreadFunction() { @@ -327,7 +344,7 @@ public void MouseThreadFunction() { #region Console Writing // Writes a line to the console private void WriteLine(string line) { - rText_console.Text += " "+line + Environment.NewLine; + rText_console.Text += " "+line + Environment.NewLine; } //Automatically scrolls down to the last line in console