it can be compiled, but doesn't work
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using DTLib;
|
||||
using System;
|
||||
using System;
|
||||
using DTLib;
|
||||
using DTLib.Filesystem;
|
||||
|
||||
namespace DTScript
|
||||
{
|
||||
@@ -9,8 +10,9 @@ namespace DTScript
|
||||
{
|
||||
try
|
||||
{
|
||||
Filework.Directory.Create("dtscript-logs");
|
||||
PublicLog.Log += Log;
|
||||
Directory.Create("dtscript-logs");
|
||||
PublicLog.LogEvent += Log;
|
||||
PublicLog.LogNoTimeEvent += Log;
|
||||
var scripter = new ScriptRunner();
|
||||
if (args.Length == 0 || args.Length > 2) throw new Exception("enter script file path\n");
|
||||
else if (args.Length == 1) scripter.RunScriptFile(args[0]);
|
||||
@@ -37,7 +39,7 @@ namespace DTScript
|
||||
if (msg.Length == 1)
|
||||
{
|
||||
msg[0] = "[" + DateTime.Now.ToString() + "]: " + msg[0];
|
||||
Filework.LogToFile(logfile, msg[0]);
|
||||
OldFilework.LogToFile(logfile, msg[0]);
|
||||
}
|
||||
else if (msg.Length % 2 != 0) throw new Exception("incorrect array to log\n");
|
||||
else
|
||||
@@ -45,7 +47,7 @@ namespace DTScript
|
||||
msg[1] = "[" + DateTime.Now.ToString() + "]: " + msg[1];
|
||||
var str = new System.Text.StringBuilder();
|
||||
for (int i = 0; i < msg.Length; i++) str.Append(msg[++i]);
|
||||
Filework.LogToFile(logfile, str.ToString());
|
||||
OldFilework.LogToFile(logfile, str.ToString());
|
||||
}
|
||||
ColoredConsole.Write(msg);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using DTLib;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Sockets;
|
||||
using static DTLib.Filework;
|
||||
using DTLib;
|
||||
using DTLib.Filesystem;
|
||||
using DTLib.Network;
|
||||
|
||||
namespace DTScript
|
||||
{
|
||||
@@ -15,6 +16,8 @@ namespace DTScript
|
||||
// выводит текст через DTLib если дебаг включен
|
||||
public bool debug = false;
|
||||
public Socket mainSocket;
|
||||
public FSP fsp;
|
||||
|
||||
internal void Debug(params string[] msg)
|
||||
{
|
||||
if (debug) PublicLog.Log(msg);
|
||||
@@ -163,20 +166,21 @@ namespace DTScript
|
||||
index++;
|
||||
break;
|
||||
case "Download":
|
||||
mainSocket.FSP_Download(script[index].Options[0], script[index].Options[1]);
|
||||
if (fsp is null) fsp = new(mainSocket);
|
||||
fsp.DownloadFile(script[index].Options[0], script[index].Options[1]);
|
||||
break;
|
||||
case "DirDelete":
|
||||
Filework.Directory.Delete(script[index].Options[0]);
|
||||
Directory.Delete(script[index].Options[0]);
|
||||
break;
|
||||
case "FileDelete":
|
||||
File.Delete(script[index].Options[0]);
|
||||
break;
|
||||
case "FileWrite":
|
||||
Filework.File.Create(script[index].Options[0]);
|
||||
File.Create(script[index].Options[0]);
|
||||
File.WriteAllText(script[index].Options[0], script[index].Options[1]);
|
||||
break;
|
||||
case "FileAppend":
|
||||
Filework.File.Create(script[index].Options[0]);
|
||||
File.Create(script[index].Options[0]);
|
||||
File.AppendAllText(script[index].Options[0], script[index].Options[1]);
|
||||
break;
|
||||
default:
|
||||
@@ -298,7 +302,7 @@ namespace DTScript
|
||||
// вычисление значений правой и левой части неравенства
|
||||
char act = '\0';
|
||||
double rezult_0 = new(), rezult_1;
|
||||
List<string> _expr = new List<string>();
|
||||
var _expr = new List<string>();
|
||||
for (ushort n = 0; n < expr.Count; n++)
|
||||
{
|
||||
Debug("m", $" <{expr[n]}>\n");
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<Content Include="dtscript_doc.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DTLib\DTLib.csproj">
|
||||
<ProjectReference Include="..\..\DTLib\DTLib.csproj">
|
||||
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
|
||||
<Name>DTLib</Name>
|
||||
</ProjectReference>
|
||||
|
||||
Reference in New Issue
Block a user