Skip to content

Commit

Permalink
Add Autostart, Ad Blocker & Small Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
kgsensei committed Aug 23, 2022
1 parent abae757 commit e40f9e5
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 35 deletions.
6 changes: 0 additions & 6 deletions NTH2/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ public async static void simulateTypingText(string Text, int typingDelay, int ac
isCheatRunning = true;
InputSimulator sim = new InputSimulator();
char[] letters = Text.Replace("\u00A0", " ").ToCharArray();
//Random rndm = new Random();
foreach (char letter in letters)
{
//int missLetter = Convert.ToInt32(Math.Floor(rndm.NextDouble() * (accuracy / 100 + 1)));
//if (missLetter == 1)
//{
// sim.Keyboard.TextEntry("a");
//}
sim.Keyboard.TextEntry(letter);
await Task.Delay(typingDelay);
}
Expand Down
22 changes: 12 additions & 10 deletions NTH2/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
xmlns:local="clr-namespace:NitroType2"
xmlns:Wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" x:Class="NitroType2.MainWindow"
mc:Ignorable="d"
Title="NitroType AutoTyper v1.2 [kgsensei]"
WindowState="Maximized" MouseDown="Window_MouseDown" AllowsTransparency="False"
Title="NitroType AutoTyper v2.0 [kgsensei]"
WindowState="Maximized" AllowsTransparency="False"
MinWidth="700" MinHeight="450" Icon="favicon.ico">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
Expand All @@ -20,11 +20,11 @@
<Button Grid.Column="1" Content="Start Cheat" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"
Width="200" Height="37" FontSize="16" Click="Button_Click" Name="startCheatBtn"/>
<Slider Grid.Column="1" HorizontalAlignment="Left" Margin="10,52,0,0" VerticalAlignment="Top" Width="200" Value="100"
Maximum="250" Minimum="35" ValueChanged="Slider_ValueChanged" Name="cheatTypeSpeedSlider"/>
<Label Grid.Column="1" Content="[Cheat Typing Speed]" HorizontalAlignment="Left" Margin="10,70,0,0" VerticalAlignment="Top"
Maximum="250" Minimum="35" ValueChanged="Slider_ValueChanged" Name="cheatTypeSpeedSlider" Panel.ZIndex="99"/>
<Label Grid.Column="1" Content="[Cheat Typing Speed]" HorizontalAlignment="Left" Margin="10,64,0,0" VerticalAlignment="Top"
Height="34" Width="200" FontSize="15"/>
<TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="10,276,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Height="254" Width="200" Name="informationalTextBlock">
<TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="10,309,0,0" TextWrapping="Wrap"
VerticalAlignment="Top" Height="221" Width="200" Name="informationalTextBlock">
This cheat takes control of your keyboard. Do NOT change tabs while in a NitroType race, it can break other programs.
<LineBreak/><LineBreak/>
Copyright © kgsensei 2022.<LineBreak/><LineBreak/>
Expand All @@ -33,11 +33,13 @@
</TextBlock>
<Label Grid.Column="1" Content="Information to Know:" HorizontalAlignment="Left" Margin="0,242,0,0"
VerticalAlignment="Top" Height="34" Width="200" FontSize="20"/>
<CheckBox Grid.Column="1" Content="God Mode" HorizontalAlignment="Left" Margin="10,197,0,0" VerticalAlignment="Top"
<CheckBox Grid.Column="1" Content="God Mode" HorizontalAlignment="Left" Margin="10,194,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"/>
<Slider Visibility="Hidden" Grid.Column="1" HorizontalAlignment="Left" Margin="10,109,0,0" VerticalAlignment="Top" Width="200" Value="100"
Maximum="100" Minimum="0" ValueChanged="cheatTypeAccSlider_ValueChanged" x:Name="cheatTypeAccSlider"/>
<Label Visibility="Hidden" Grid.Column="1" Content="[Cheat Typing Accuracy]" HorizontalAlignment="Left" Margin="10,133,0,0" VerticalAlignment="Top"
<Slider Grid.Column="1" HorizontalAlignment="Left" Margin="10,98,0,0" VerticalAlignment="Top" Width="200" Value="100"
Maximum="100" Minimum="0" ValueChanged="cheatTypeAccSlider_ValueChanged" x:Name="cheatTypeAccSlider" IsEnabled="False" Panel.ZIndex="99"/>
<Label Grid.Column="1" Content="[Cheat Typing Accuracy]" HorizontalAlignment="Left" Margin="10,110,0,0" VerticalAlignment="Top"
Height="34" Width="200" FontSize="15"/>
<CheckBox Grid.Column="1" Content="Automatic Start" HorizontalAlignment="Left" Margin="10,149,0,0" VerticalAlignment="Top"
Height="40" Width="200" FontSize="16" Checked="CheckBox_Checked_1" Unchecked="CheckBox_Unchecked_1"/>
</Grid>
</mah:MetroWindow>
94 changes: 84 additions & 10 deletions NTH2/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class thingsorwhatever
public static int typingSpeed { get; set; } = 5;
public static int accuracyLvl { get; set; } = 100;
public static bool godMode { get; set; } = false;
public static bool autoStart { get; set; } = false;
}

/// <summary>
Expand All @@ -32,6 +33,58 @@ public partial class MainWindow : MetroWindow
public MainWindow()
{
InitializeComponent();
AsyncInitialize();
}

public async void AsyncInitialize()
{
await webview2.EnsureCoreWebView2Async();
webview2.CoreWebView2.WebResourceRequested += CoreWebView2_WebResourceRequested;
webview2.CoreWebView2.AddWebResourceRequestedFilter(null, Microsoft.Web.WebView2.Core.CoreWebView2WebResourceContext.All);
webview2.CoreWebView2.WebResourceResponseReceived += CoreWebView2_WebResourceResponseReceived;
}

private void CoreWebView2_WebResourceResponseReceived(object sender, Microsoft.Web.WebView2.Core.CoreWebView2WebResourceResponseReceivedEventArgs e)
{
if (e.Request.Uri.IndexOf("nitrotype.com/race") != -1 && thingsorwhatever.autoStart == true)
{
webview2.ExecuteScriptAsync(@"
function cheatStart(){
if(document.getElementsByClassName('raceChat').length?false:true){
z=document.getElementsByClassName('dash-letter');
m='';for(let i=0;i<z.length;i++){m=m+z[i].innerText};
window.chrome.webview.postMessage(''+m);
}else{
setTimeout(()=>{cheatStart()},5);
}
};setTimeout(()=>{cheatStart()},2000);");
}
}

private void CoreWebView2_WebResourceRequested(object sender, Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestedEventArgs e)
{
string uri = e.Request.Uri;
if (uri.IndexOf("googlesyndication") != -1 ||
uri.IndexOf("adservice") != -1 ||
uri.IndexOf("adsystem") != -1 ||
uri.IndexOf("adsafeprotected") != -1 ||
uri.IndexOf("facebook") != -1 ||
uri.IndexOf("googletagmanager") != -1 ||
uri.IndexOf("google-analytics") != -1 ||
uri.IndexOf("ad-delivery") != -1 ||
uri.IndexOf("doubleclick") != -1 ||
uri.IndexOf("adlightning") != -1 ||
uri.IndexOf("smartadserver") != -1 ||
uri.IndexOf("quantserve") != -1 ||
uri.IndexOf("qccerttest") != -1 ||
uri.IndexOf("qualaroo") != -1 ||
uri.IndexOf("criteo") != -1 ||
uri.IndexOf("moatads") != -1 ||
uri.IndexOf("intergi") != -1 ||
uri.IndexOf("playwire") != -1)
{
e.Response = webview2.CoreWebView2.Environment.CreateWebResourceResponse(null, 404, "Not found", null);
}
}

private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
Expand All @@ -44,11 +97,20 @@ private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<d
}
}

//document.getElementsByClassName('raceChat')

async private void Button_Click(object sender, RoutedEventArgs e)
{
if (webview2.Source.ToString().IndexOf("nitrotype.com/race") != -1)
if (webview2.Source.ToString().IndexOf("nitrotype.com/race") != -1 && thingsorwhatever.autoStart == false)
{
await webview2.ExecuteScriptAsync("if(document.getElementsByClassName('raceChat').length?false:true){z=document.getElementsByClassName('dash-letter');m='';for(let i=0;i<z.length;i++){m=m+z[i].innerText};window.chrome.webview.postMessage(''+m);}else{window.chrome.webview.postMessage('GAME_NOT_STARTED_ERROR');}");
await webview2.ExecuteScriptAsync(@"
if(document.getElementsByClassName('raceChat').length?false:true){
z=document.getElementsByClassName('dash-letter');
m='';for(let i=0;i<z.length;i++){m=m+z[i].innerText};
window.chrome.webview.postMessage(''+m);
}else{
window.chrome.webview.postMessage('GAME_NOT_STARTED_ERROR');
}");
}
else
{
Expand All @@ -74,21 +136,14 @@ private void Webview2_WebMessageReceived(object sender, Microsoft.Web.WebView2.C
}
}

private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (App.isCheatRunning)
{
webview2.Focus();
}
}

private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
if (!App.isCheatRunning)
{
thingsorwhatever.typingSpeed = 0;
thingsorwhatever.accuracyLvl = 100;
thingsorwhatever.godMode = true;
cheatTypeSpeedSlider.IsEnabled = false;
}
}

Expand All @@ -101,6 +156,7 @@ private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
thingsorwhatever.typingSpeed = total - change;
thingsorwhatever.accuracyLvl = Convert.ToInt32(cheatTypeAccSlider.Value);
thingsorwhatever.godMode = false;
cheatTypeSpeedSlider.IsEnabled = true;
}
}

Expand All @@ -111,5 +167,23 @@ private void cheatTypeAccSlider_ValueChanged(object sender, RoutedPropertyChange
thingsorwhatever.accuracyLvl = Convert.ToInt32(e.NewValue);
}
}

private void CheckBox_Checked_1(object sender, RoutedEventArgs e)
{
if (!App.isCheatRunning)
{
thingsorwhatever.autoStart = true;
startCheatBtn.IsEnabled = false;
}
}

private void CheckBox_Unchecked_1(object sender, RoutedEventArgs e)
{
if (!App.isCheatRunning)
{
thingsorwhatever.autoStart = false;
startCheatBtn.IsEnabled = true;
}
}
}
}
23 changes: 14 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@

## How to Use

Just click this [link](https://github.com/kgsensei/NitroTypeHack2/releases), click on the button that says `nitroTypeInstaller.exe` and go though the software installer. That's it, really, its that easy.
1. Click this [link](https://github.com/kgsensei/NitroTypeHack2/releases).
2. Click on the button that says `nitroTypeInstaller.exe`.
3. Click run the installer you downloaded.
4. Open up the cheat application.
5. Enjoy!

## Help/Support

If you need help with anything or you want to report a feature that is broken/request a new feature you can join my help discord server [here](https://discord.gg/U5A3QWXZKZ). You can also create a new GitHub issue [here](https://github.com/kgsensei/NitroTypeHack2/issues).
If you need help with anything or you want to report a feature that is broken/request a new feature...
You can join my help discord server [here](https://discord.gg/U5A3QWXZKZ).
You can also create a new GitHub issue [here](https://github.com/kgsensei/NitroTypeHack2/issues).

## Features/Advantages

- Currently Working
- Free & Open Source
- Working
- Easy Download & Setup
- Customizable Speed Slider
- Runs Like A Desktop App
- Has A God Mode Option
- Easy to Setup & Run
- Runs Like a Desktop App
- Built in Ad Blocker

Can reach ~33,000 WPM at ~100% Accuracy.

## Screenshots

![Interface Preview](/screenshots/1.png)
Preview of the Interface
Preview of Cheat Interface


![God Mode Preview](/screenshots/2.png)
An Example of God Mode (You Will be Banned)
Preview of Cheat Capabilities

## Legal

Expand Down
Binary file modified screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e40f9e5

Please sign in to comment.