Browse Source

new script commands

Kajetan Johannes Hammerle 4 years ago
parent
commit
0019b175c6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/me/hammerle/snuviscript/code/FunctionRegistry.java

+ 2 - 0
src/me/hammerle/snuviscript/code/FunctionRegistry.java

@@ -72,6 +72,8 @@ public class FunctionRegistry {
             }
             return null;
         });
+        registerFunction("script.getfromid", (sc, in) -> sc.getScriptManager().getScript(in[0].getInt(sc)));
+        registerFunction("script.getid", (sc, in) -> (double) ((Script) in[0].get(sc)).getId());
         registerFunction("script.getall", (sc, in) -> {
             String name = in[0].getString(sc);
             return sc.getScriptManager().getScripts().stream()