Skip to content

Commit

Permalink
Fixed Solo public lobby
Browse files Browse the repository at this point in the history
Solo public lobby generator fixed
changed hotkeys
  • Loading branch information
AleksanderEvensen committed Dec 4, 2019
1 parent 1dcf011 commit eb7ecbd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
4 changes: 2 additions & 2 deletions GTATool/GTATool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<HintPath>..\packages\GlobalHotKey.1.1.0\lib\GlobalHotKey.dll</HintPath>
</Reference>
<Reference Include="SimpleUI">
<HintPath>./DLLs/SimpleUI.dll</HintPath>
<HintPath>DLLs\SimpleUI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -107,4 +107,4 @@
<None Include="Resources\--.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion GTATool/MainWindow.Designer.cs

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

41 changes: 29 additions & 12 deletions GTATool/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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));
}


Expand Down Expand Up @@ -237,25 +243,19 @@ 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
if(GTAProcess != null) {
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;

Expand Down Expand Up @@ -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


Expand All @@ -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() {
Expand All @@ -327,7 +344,7 @@ public void MouseThreadFunction() {
#region Console Writing
// Writes a line to the console
private void WriteLine(string line) {
rText_console.Text += " <GTATool> "+line + Environment.NewLine;
rText_console.Text += " <GTATool> "+line + Environment.NewLine;
}

//Automatically scrolls down to the last line in console
Expand Down

0 comments on commit eb7ecbd

Please sign in to comment.