Add Run multiple commands at one time

This commit is contained in:
2023-09-20 12:56:38 +08:00
parent 78be273c7a
commit 41c644f2af
3 changed files with 30 additions and 3 deletions

View File

@@ -190,11 +190,21 @@ namespace GrasscutterTools
try
{
foreach (var cmd in commands.Split('|').Select(FormatCommand))
Common.OC.Ping().Wait(1000);
if (Common.OC.CanInvokeMultipleCmd)
{
var msg = Common.OC.Invoke(cmd).Result;
var msg = Common.OC.Invoke(FormatCommand(commands)).Result;
Console.WriteLine(string.IsNullOrEmpty(msg) ? "OK" : msg);
}
else
{
foreach (var cmd in commands.Split('|').Select(FormatCommand))
{
var msg = Common.OC.Invoke(cmd).Result;
Console.WriteLine(string.IsNullOrEmpty(msg) ? "OK" : msg);
}
}
return true;
}
catch (Exception ex)