the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
30
EscapeFromTarkovCheat/Utils/AllocConsoleHandler.cs
Normal file
30
EscapeFromTarkovCheat/Utils/AllocConsoleHandler.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
//Credits myshmeh
|
||||
namespace EscapeFromTarkovCheat.Utils
|
||||
{
|
||||
public static class AllocConsoleHandler
|
||||
{
|
||||
[DllImport("Kernel32.dll")]
|
||||
private static extern bool AllocConsole();
|
||||
|
||||
[DllImport("msvcrt.dll")]
|
||||
public static extern int system(string cmd);
|
||||
|
||||
public static void Open()
|
||||
{
|
||||
AllocConsole();
|
||||
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true });
|
||||
Application.logMessageReceivedThreaded += (condition, stackTrace, type) => Console.WriteLine(condition + " " + stackTrace);
|
||||
}
|
||||
|
||||
public static void ClearAllocConsole()
|
||||
{
|
||||
system("CLS");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue