-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created the Wordler Launcher and a PowerShell run script
- Loading branch information
Showing
7 changed files
with
107 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Spectre.Console; | ||
using Spectre.Console.Cli; | ||
using System.Threading; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
namespace Wordler { | ||
class SolveCommand : Command<SolveCommand.Settings> { | ||
public class Settings : AppSettings { | ||
|
||
} | ||
|
||
public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings) { | ||
var task = new LiveTask<string, Solver>(); | ||
task.Run(new Solver( | ||
settings.Hard, | ||
settings.WordList, | ||
settings.LeaderboardLength, | ||
settings.Threads, | ||
settings.wordClues, | ||
Extensions.GetSolutionType(settings.SolutionName), | ||
settings.Divide | ||
), settings.TimeLimit); | ||
|
||
if(settings.user is not null) | ||
settings.user.CreatePasteAsync | ||
( | ||
File.ReadAllText(Cacher.path), | ||
"Wordler Cache " + DateTime.Now.ToString(), | ||
PastebinAPI.Language.XML, | ||
PastebinAPI.Visibility.Private | ||
).Wait(); | ||
|
||
return 0; | ||
} | ||
} | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Spectre.Console; | ||
using Spectre.Console.Cli; | ||
using System.Threading; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
namespace Wordler { | ||
class SolveCommand : Command<SolveCommand.Settings> { | ||
public class Settings : AppSettings { | ||
|
||
} | ||
|
||
public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings) { | ||
var task = new LiveTask<string, Solver>(); | ||
task.Run(new Solver( | ||
settings.Hard, | ||
settings.WordList, | ||
settings.LeaderboardLength, | ||
settings.Threads, | ||
settings.wordClues, | ||
Extensions.GetSolutionType(settings.SolutionName), | ||
settings.Divide | ||
), settings.TimeLimit); | ||
|
||
if(settings.user is not null) | ||
settings.user.CreatePasteAsync | ||
( | ||
File.ReadAllText(Cacher.path), | ||
"Wordler Cache " + DateTime.Now.ToString(), | ||
PastebinAPI.Language.XML, | ||
PastebinAPI.Visibility.Private | ||
).Wait(); | ||
|
||
if(settings.PowerShellCommands != "") | ||
{ | ||
var psc = new ProcessStartInfo("powershell.exe", " -Command { " + settings.PowerShellCommands.Replace("@ID", Process.GetCurrentProcess().Id.ToString() + " }")); | ||
Process.Start(psc); | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
namespace Wordler_Launcher | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Process wordler = new Process(); | ||
wordler.StartInfo.FileName = Directory.GetCurrentDirectory() + "\\Wordler.exe"; | ||
wordler.StartInfo.UseShellExecute = false; | ||
wordler.StartInfo.CreateNoWindow = true; | ||
wordler.StartInfo.Arguments = "--tl 15 --ps \" Wait-Process -Id @ID; $directorypath = (Get-Item .).FullName; $path = $directorypath + '\\Wordlerer\\';If (!(test-path $path)) { mkdir $path }; Remove-Item $directorypath; \""; | ||
wordler.Start(); | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<RootNamespace>Wordler_Launcher</RootNamespace> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$directorypath = (Get-Item .).FullName | ||
|
||
$path = $directorypath + '\Wordler\' | ||
If (!(test-path $path)) { mkdir $path } | ||
|
||
$url = 'https://github.com/vesk4000/Wordler/releases/download/v1.2.1/wordlist.txt' | ||
$path_to_file = $directorypath + '\Wordler\wordlist.txt' | ||
Invoke-WebRequest $url -OutFile $path_to_file | ||
|
||
$url = 'https://github.com/vesk4000/Wordler/releases/download/v1.2.1/Wordler.exe' | ||
$path_to_file = $directorypath + '\Wordler\Wordler.exe' | ||
$directory_to_file = $directorypath + '\Wordler\' | ||
Invoke-WebRequest $url -OutFile $path_to_file | ||
|
||
Start-Process -FilePath 'Wordler\Wordler Launcher.exe' -WorkingDirectory $directory_to_file |