Skip to content

Commit

Permalink
Started work on v4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kgsensei committed Jan 21, 2024
1 parent 55dec3c commit bdcd5a7
Show file tree
Hide file tree
Showing 426 changed files with 22,561 additions and 116,289 deletions.
Binary file modified .vs/NitroTypeHack2/v17/.suo
Binary file not shown.
6 changes: 3 additions & 3 deletions NitroTypeHack2/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2045.28" newVersion="1.0.2045.28" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2210.55" newVersion="1.0.2210.55" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
Expand All @@ -43,7 +43,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.1" newVersion="7.0.0.1" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
Expand Down
46 changes: 29 additions & 17 deletions NitroTypeHack2/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,66 +31,78 @@ public async static void simulateTypingText(
char[] letters = text.Replace("\u00A0", " ").ToCharArray();
var gen = new Random();

char[] allowedCharsToMiss = { '+', '-', '=', '[', ']', '<', '>', '`', '~' };

int toMiss = (int)Math.Floor(letters.Length * ((decimal)(100 - accuracy) / 100));
int maxIndex = (int)Math.Floor(letters.Length / (decimal)(toMiss + 1));
int index = 0;

foreach (char letter in letters)
for (int i = 0; i < letters.Length; i++)
{
char letter = letters[i];

if (letter == 'ʜ')
{
string args;
args = @"{""type"": ""rawKeyDown"", ""windowsVirtualKeyCode"": 13, ""unmodifiedText"": ""\r"", ""text"": ""\r""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
"Input.dispatchKeyEvent",
args
);

args = @"{""type"": ""keyUp"", ""windowsVirtualKeyCode"": 13, ""unmodifiedText"": ""\r"", ""text"": ""\r""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
"Input.dispatchKeyEvent",
args
);

// Do this to avoid the space as next character,
// if we press it then the accuracy level will
// be offset.
i++;
}
else
{
string args;
// Letter 32 is a newline character
if (letter == 32)
{
args = @"{""type"": ""rawKeyDown"", ""windowsVirtualKeyCode"": 32, ""unmodifiedText"": "" "", ""text"": "" ""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
"Input.dispatchKeyEvent",
args
);

args = @"{""type"": ""keyUp"", ""windowsVirtualKeyCode"": 32, ""unmodifiedText"": "" "", ""text"": "" ""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
"Input.dispatchKeyEvent",
args
);
}
else
{
args = @"{""type"": ""char"", ""text"": """ + letter + @"""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
"Input.dispatchKeyEvent",
args
);
}
}

if (index == maxIndex)
{
string args = @"{""type"": ""char"", ""text"": ""+""}";
// This will get one of the random 'allowed to miss' characters,
// that way we aren't using the same one for every miss.
string args = @"{""type"": ""char"", ""text"": """ + allowedCharsToMiss[gen.Next(0, allowedCharsToMiss.Length - 1)] + @"""}";
_ = await webview2.CoreWebView2.CallDevToolsProtocolMethodAsync(
"Input.dispatchKeyEvent",
args
);
"Input.dispatchKeyEvent",
args
);
index = 0;
}
else
{
index = index + 1;
index++;
}

if(!Globals.godMode)
Expand All @@ -101,7 +113,7 @@ public async static void simulateTypingText(

if (Globals.autoGame)
{
await Task.Delay(gen.Next(4900, 6100));
await Task.Delay(gen.Next(5000, 6500));
webview2.Reload();
}

Expand Down
186 changes: 155 additions & 31 deletions NitroTypeHack2/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,179 @@
xmlns:Wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
x:Class="NitroTypeHack2.MainWindow"
mc:Ignorable="d"
Title="NitroType Cheat 4.3 | kgsensei"
Title="NitroType Cheat 4.4 | kgsensei"
WindowState="Maximized"
Height="450"
Width="800">
Width="800"
MinWidth="750"
MinHeight="400"
Icon="/logo.png">
<Grid Background="#FF141419">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="85*" MinWidth="500"/>
<ColumnDefinition Width="220" MinWidth="220"/>
<ColumnDefinition Width="*" MinWidth="500"/>
<ColumnDefinition Width="240" MinWidth="240"/>
</Grid.ColumnDefinitions>


<Wpf:WebView2 Grid.Column="0" Name="webview2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Source="https://nitrotype.com" Margin="0,0,0,0" WebMessageReceived="Webview2_WebMessageReceived"/>
<Wpf:WebView2
Grid.Column="0"
Name="webview2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="0,0,0,0"
WebMessageReceived="Webview2_WebMessageReceived"/>


<Button Grid.Column="1" Content="Start Cheat" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"
Width="200" Height="37" FontSize="16" Click="button_start_cheat" Name="startCheatBtn" Background="#FF1E1E23"
Foreground="White" BorderBrush="#FF323237" FontFamily="Arial"/>
<Grid Grid.Column="1">
<Button
Content="Start Cheat"
HorizontalAlignment="Left"
Margin="10,10,0,0"
VerticalAlignment="Top"
Width="200"
Height="37"
FontSize="16"
Click="button_start_cheat"
Name="startCheatBtn"
Background="#FF1E1E23"
Foreground="White"
BorderBrush="#FF323237"
FontFamily="Arial"/>

<Slider Grid.Column="1" HorizontalAlignment="Left" Margin="10,52,0,0" VerticalAlignment="Top" Width="200" Value="100"
Maximum="350" Minimum="30" ValueChanged="slider_change_speed" Name="cheatTypeSpeedSlider" Panel.ZIndex="99"
Foreground="White"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="45"/>
</Grid.ColumnDefinitions>

<Label Grid.Column="1" Content="[Cheat Typing Speed]" HorizontalAlignment="Left" Margin="10,64,0,0" VerticalAlignment="Top"
Height="34" Width="200" FontSize="15" Foreground="White"/>
<Slider
Grid.Column="0"
HorizontalAlignment="Stretch"
Margin="10,52,0,0"
VerticalAlignment="Top"
Value="100"
Maximum="350"
Minimum="30"
ValueChanged="slider_change_speed"
Name="cheatTypeSpeedSlider"
Panel.ZIndex="99"
Foreground="White"/>

<Label
Grid.Column="0"
Content="[Words Per Minute Slider]"
HorizontalAlignment="Left"
Margin="10,64,0,0"
VerticalAlignment="Top"
FontSize="14"
Foreground="White"/>

<Slider Grid.Column="1" HorizontalAlignment="Left" Margin="10,98,0,0" VerticalAlignment="Top" Width="200" Value="100"
Maximum="100" Minimum="0" x:Name="cheatTypeAccSlider" Panel.ZIndex="99"
Foreground="White" ValueChanged="slider_change_accuracy"/>
<Label
Name="wpmDisplay"
Grid.Column="1"
Content="~45"
HorizontalAlignment="Left"
Margin="0,45,0,0"
VerticalAlignment="Top"
Width="45"
FontSize="14"
Foreground="White"/>
</Grid>

<Label Grid.Column="1" Content="[Cheat Typing Accuracy]" HorizontalAlignment="Left" Margin="10,110,0,0" VerticalAlignment="Top"
Height="34" Width="200" FontSize="15" Foreground="White"/>

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="45"/>
</Grid.ColumnDefinitions>

<Slider
Grid.Column="0"
HorizontalAlignment="Stretch"
Margin="10,98,0,0"
VerticalAlignment="Top"
Value="100"
Maximum="100"
Minimum="0"
x:Name="cheatTypeAccSlider"
Panel.ZIndex="99"
Foreground="White"
ValueChanged="slider_change_accuracy"/>

<CheckBox Grid.Column="1" Content="Auto Start" HorizontalAlignment="Left" Margin="10,180,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Background="#FF646469" BorderBrush="#FF28282D" Foreground="White" IsChecked="True"
Checked="button_AutoStartOn" Unchecked="button_AutoStartOff"/>
<Label
Grid.Column="0"
Content="[Typing Accuracy]"
HorizontalAlignment="Left"
Margin="10,110,0,0"
VerticalAlignment="Top"
FontSize="14"
Foreground="White"/>

<CheckBox Grid.Column="1" Content="God Mode" HorizontalAlignment="Left" Margin="10,215,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Background="#FF646469" Name="button_GodMode"
BorderBrush="#FF28282D" Foreground="White" Checked="button_GodModeEnabled" Unchecked="button_GodModeDisabled"/>
<Label
Name="accDisplay"
Grid.Column="1"
Content="100%"
HorizontalAlignment="Left"
Margin="0,91,0,0"
VerticalAlignment="Top"
Width="45"
FontSize="14"
Foreground="White"/>
</Grid>

<CheckBox Grid.Column="1" Content="Auto Game" HorizontalAlignment="Center" Margin="0,250,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Background="#FF646469" BorderBrush="#FF28282D" Foreground="White"
Checked="button_AutoGameOn" Unchecked="button_AutoGameOff" Name="button_AutoGame"/>

<CheckBox
Content="Auto Start"
HorizontalAlignment="Left"
Margin="10,180,0,0"
VerticalAlignment="Top"
FontSize="16" Background="#FF646469"
BorderBrush="#FF28282D" Foreground="White"
IsChecked="True"
Checked="button_AutoStartOn"
Unchecked="button_AutoStartOff"/>

<CheckBox Grid.Column="1" Content="Use Nitros" HorizontalAlignment="Center" Margin="0,285,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Background="#FF646469" BorderBrush="#FF28282D" Foreground="White"
Checked="button_UseNitrosOn" Unchecked="button_UseNitrosOff" Name="button_UseNitros"/>

<CheckBox
Content="God Mode"
HorizontalAlignment="Left"
Margin="10,215,0,0"
VerticalAlignment="Top"
FontSize="16"
Background="#FF646469"
Name="button_GodMode"
BorderBrush="#FF28282D"
Foreground="White"
Checked="button_GodModeEnabled"
Unchecked="button_GodModeDisabled"/>


<CheckBox
Content="Auto Game"
HorizontalAlignment="Left"
Margin="10,250,0,0"
VerticalAlignment="Top"
FontSize="16"
Background="#FF646469"
BorderBrush="#FF28282D"
Foreground="White"
Checked="button_AutoGameOn"
Unchecked="button_AutoGameOff"
Name="button_AutoGame"/>


<CheckBox
Content="Use Nitros"
HorizontalAlignment="Left"
Margin="10,285,0,0"
VerticalAlignment="Top"
FontSize="16"
Background="#FF646469"
BorderBrush="#FF28282D"
Foreground="White"
Checked="button_UseNitrosOn"
Unchecked="button_UseNitrosOff"
Name="button_UseNitros"/>
</Grid>
</Grid>
</Window>
Loading

0 comments on commit bdcd5a7

Please sign in to comment.