From adcbe1f23213cb16cfc1b194836b5d30bb36dbc1 Mon Sep 17 00:00:00 2001 From: Rexo35 <98764898+Rexo35@users.noreply.github.com> Date: Tue, 23 Aug 2022 18:29:36 +0200 Subject: [PATCH] Add the "ZS.System.Command" function Add the "ZS.System.Command" function in order to run console commands. Something like pythons os.system() function. --- ZSharp/builtin.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZSharp/builtin.h b/ZSharp/builtin.h index 4fda055..83f8306 100644 --- a/ZSharp/builtin.h +++ b/ZSharp/builtin.h @@ -13,6 +13,7 @@ #include #include #include +#include // for console command printing #include "strops.h" #include "graphics.h" @@ -467,6 +468,8 @@ boost::any ZSFunction(const string& name, const vector& args) Vec2 v(AnyAsFloat(args.at(0)), AnyAsFloat(args.at(1))); return v; } + else if (name == "ZS.System.Command") + temp = system(StringRaw(AnyAsString(args.at(0)))); else LogWarning("ZS function \'" + name + "\' does not exist.");