mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix script not showing execution results.
This commit is contained in:
parent
8db0467f69
commit
338f534239
5 changed files with 88 additions and 7 deletions
|
|
@ -5,6 +5,7 @@ using System.IO;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using MinecraftClient.CommandHandler;
|
||||
using MinecraftClient.Scripting;
|
||||
|
||||
namespace MinecraftClient.ChatBots
|
||||
|
|
@ -85,7 +86,7 @@ namespace MinecraftClient.ChatBots
|
|||
public static bool LookForScript(ref string filename)
|
||||
{
|
||||
//Automatically look in subfolders and try to add ".txt" file extension
|
||||
char dir_slash = Path.DirectorySeparatorChar;
|
||||
char dir_slash = Path.DirectorySeparatorChar;
|
||||
string[] files = new string[]
|
||||
{
|
||||
filename,
|
||||
|
|
@ -210,11 +211,22 @@ namespace MinecraftClient.ChatBots
|
|||
sleepticks = ticks;
|
||||
break;
|
||||
default:
|
||||
if (!PerformInternalCommand(instruction_line))
|
||||
CmdResult response = new();
|
||||
if (PerformInternalCommand(instruction_line, ref response))
|
||||
{
|
||||
if (instruction_name.ToLower() != "log")
|
||||
{
|
||||
LogToConsole(instruction_line);
|
||||
}
|
||||
if (response.status != CmdResult.Status.Done || !string.IsNullOrWhiteSpace(response.result))
|
||||
{
|
||||
LogToConsole(response);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Update(); //Unknown command : process next line immediately
|
||||
}
|
||||
else if (instruction_name.ToLower() != "log") { LogToConsole(instruction_line); }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue