diff --git a/.gitignore b/.gitignore index 15e9726..26cfce7 100644 --- a/.gitignore +++ b/.gitignore @@ -339,6 +339,8 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb -CompletionPlugin -InfiniteManaPlugin -RawRBot \ No newline at end of file +RawRBot +RBot/ActionScript/rbot/bin +RBot/rbot_blank.swf +RBot/Properties/licenses.licx +RBot/bin \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b48b78a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/RBot/bin/Debug/net6.0-windows/RBot.dll", + "args": [], + "cwd": "${workspaceFolder}/RBot", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..42dc703 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/RBot/RBot.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/RBot/RBot.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "${workspaceFolder}/RBot/RBot.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/RBot.sln b/RBot.sln index 3310749..1d4faf9 100644 --- a/RBot.sln +++ b/RBot.sln @@ -1,38 +1,32 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29318.209 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31919.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RBot", "RBot\RBot.csproj", "{F45DFF0C-BD43-4F16-A947-44585DED4A29}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompletionPlugin", "CompletionPlugin\CompletionPlugin.csproj", "{98CC4B08-BA36-4547-B6BA-23FFC7841A8A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InfiniteManaPlugin", "InfiniteManaPlugin\InfiniteManaPlugin.csproj", "{4DF7EC6B-1665-48CF-97AF-B26D3842535A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RawRBot", "RawRBot\RawRBot.csproj", "{5F8F2CE1-F842-4D0C-BB91-DD46613C1A0E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RBot", "RBot\RBot.csproj", "{F45DFF0C-BD43-4F16-A947-44585DED4A29}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|x64.ActiveCfg = Debug|x64 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|x64.Build.0 = Debug|x64 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|x86.ActiveCfg = Debug|x86 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Debug|x86.Build.0 = Debug|x86 {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|Any CPU.ActiveCfg = Release|Any CPU {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|Any CPU.Build.0 = Release|Any CPU - {98CC4B08-BA36-4547-B6BA-23FFC7841A8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {98CC4B08-BA36-4547-B6BA-23FFC7841A8A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {98CC4B08-BA36-4547-B6BA-23FFC7841A8A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {98CC4B08-BA36-4547-B6BA-23FFC7841A8A}.Release|Any CPU.Build.0 = Release|Any CPU - {4DF7EC6B-1665-48CF-97AF-B26D3842535A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4DF7EC6B-1665-48CF-97AF-B26D3842535A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4DF7EC6B-1665-48CF-97AF-B26D3842535A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4DF7EC6B-1665-48CF-97AF-B26D3842535A}.Release|Any CPU.Build.0 = Release|Any CPU - {5F8F2CE1-F842-4D0C-BB91-DD46613C1A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F8F2CE1-F842-4D0C-BB91-DD46613C1A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F8F2CE1-F842-4D0C-BB91-DD46613C1A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F8F2CE1-F842-4D0C-BB91-DD46613C1A0E}.Release|Any CPU.Build.0 = Release|Any CPU + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|x64.ActiveCfg = Release|x64 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|x64.Build.0 = Release|x64 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|x86.ActiveCfg = Release|x86 + {F45DFF0C-BD43-4F16-A947-44585DED4A29}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RBot/.editorconfig b/RBot/.editorconfig index 864769d..2aea850 100644 --- a/RBot/.editorconfig +++ b/RBot/.editorconfig @@ -5,3 +5,9 @@ dotnet_diagnostic.CA1303.severity = none # CS1591: Missing XML comment for publicly visible type or member dotnet_diagnostic.CS1591.severity = none + +# CS0108: Member hides inherited member; missing new keyword +dotnet_diagnostic.CS0108.severity = none + +# IDE1006: Naming Styles +dotnet_diagnostic.IDE1006.severity = none diff --git a/RBot/AS3InjectorForm.cs b/RBot/AS3InjectorForm.cs deleted file mode 100644 index 8f4e805..0000000 --- a/RBot/AS3InjectorForm.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Text; -using System.Linq; -using System.Diagnostics; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.IO; - -using RBot.Flash; - -namespace RBot -{ - public partial class AS3InjectorForm : HideForm - { - const string DefaultText = "package {\r\n\r\n\timport flash.display.*;\r\n\timport flash.external.*;\r\n\r\n\tpublic class Patch extends MovieClip {\r\n\r\n private var game:*;\r\n\r\n\t\tpublic function run(root:*) {\r\n game = root.getGame();\r\n \r\n \r\n\t\t}\r\n\t}\r\n}"; - - public string CurrentFile { get; set; } - private bool _modified; - public bool Modified - { - get => _modified; - set - { - Text = "AS3 Injector - " + (CurrentFile ?? "Unsaved.as") + (value ? "*" : ""); - _modified = value; - } - } - - public AS3InjectorForm() - { - InitializeComponent(); - - KeyPreview = true; - txtCode.DescriptionFile = "AS3Style.xml"; - txtCode.Text = DefaultText; - txtCode.TextChanged += TxtCode_TextChanged; - } - - private void TxtCode_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) - { - Modified = true; - } - - private void newToolStripMenuItem_Click(object sender, EventArgs e) - { - if (!Modified || MessageBox.Show("The current script has unsaved changes which will be lost if a new script is started. Are you sure you would like to start a new script?", "Unsaved Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) - { - txtCode.Text = DefaultText; - CurrentFile = null; - Modified = false; - } - } - - private void openToolStripMenuItem_Click(object sender, EventArgs e) - { - if (!Modified || MessageBox.Show("The current script has unsaved changes which will be lost if another script is opened. Are you sure you would like to open a new script?", "Unsaved Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "ActionScript Files (*.as)|*.as"; - if (ofd.ShowDialog() == DialogResult.OK) - { - CurrentFile = ofd.FileName; - txtCode.Text = File.ReadAllText(CurrentFile); - Modified = false; - } - } - } - } - - private void saveToolStripMenuItem_Click(object sender, EventArgs e) - { - if (CurrentFile == null) - saveAsToolStripMenuItem.PerformClick(); - else - { - File.WriteAllText(CurrentFile, txtCode.Text); - Modified = false; - } - } - - private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) - { - using (SaveFileDialog sfd = new SaveFileDialog()) - { - sfd.Filter = "ActionScript Files (*.as)|*.as"; - if (sfd.ShowDialog() == DialogResult.OK) - { - CurrentFile = sfd.FileName; - Modified = false; - File.WriteAllText(CurrentFile, txtCode.Text); - } - } - } - - private async void injectToolStripMenuItem_Click(object sender, EventArgs e) - { - injectToolStripMenuItem.Enabled = false; - injectToolStripMenuItem.Text = "Compiling..."; - - await Task.Run(() => - { - File.WriteAllText("tmp/Patch.as", txtCode.Text); - - Process p = Process.Start(new ProcessStartInfo("tools/as3compile.exe") - { - Arguments = "tmp/Patch.as -o tmp/Patch.swf", - UseShellExecute = false, - CreateNoWindow = true, - RedirectStandardError = true - }); - - StringBuilder sb = new StringBuilder(); - using (StreamReader err = p.StandardError) - { - while (!err.EndOfStream) - sb.AppendLine(err.ReadLine()); - } - - p.WaitForExit(); - if (p.ExitCode == 0) - { - injectToolStripMenuItem.Text = "Injecting..."; - FlashUtil.Call("injectScript", new Uri(Path.Combine(Environment.CurrentDirectory, "tmp", "Patch.swf")).AbsoluteUri); - } - else - MessageBox.Show($"Compiler exited with code {p.ExitCode}:\r\n{sb.ToString()}", "Compile Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - }); - - injectToolStripMenuItem.Text = "Inject (Ctrl+F5)"; - injectToolStripMenuItem.Enabled = true; - } - } -} diff --git a/RBot/AS3InjectorForm.resx b/RBot/AS3InjectorForm.resx deleted file mode 100644 index 2ed35b3..0000000 --- a/RBot/AS3InjectorForm.resx +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdGYXN0Q29sb3JlZFRleHRCb3gsIFZlcnNpb249Mi4xNi4yNC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWZiOGFhMTJiOTk0ZWY2MWIMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACJGYXN0Q29sb3JlZFRleHRCb3hOUy5TZXJ2aWNlQ29sb3JzBgAA - ACg8Q29sbGFwc2VNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxDb2xsYXBzZU1hcmtlckJh - Y2tDb2xvcj5rX19CYWNraW5nRmllbGQqPENvbGxhcHNlTWFya2VyQm9yZGVyQ29sb3I+a19fQmFja2lu - Z0ZpZWxkJjxFeHBhbmRNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkJjxFeHBhbmRNYXJrZXJC - YWNrQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxFeHBhbmRNYXJrZXJCb3JkZXJDb2xvcj5rX19CYWNraW5n - RmllbGQEBAQEBAQUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAA - ABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5E - cmF3aW5nLkNvbG9yAwAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAACAAAABfz///8UU3lzdGVtLkRy - YXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAACgAAAAAA - AAAAlgABAAH7/////P///woAAAAAAAAAAKQAAQAB+v////z///8KAAAAAAAAAACWAAEAAfn////8//// - CgAAAAAAAAAAjQABAAH4/////P///woAAAAAAAAAAKQAAQAB9/////z///8KAAAAAAAAAACWAAEACw== - - - - 17, 17 - - \ No newline at end of file diff --git a/RBot/AS3Style.xml b/RBot/AS3Style.xml deleted file mode 100644 index 1fb2048..0000000 --- a/RBot/AS3Style.xml +++ /dev/null @@ -1,14 +0,0 @@ - - -