From a875f153a2970e0ea5480424dcaf4a6c30dfa3a1 Mon Sep 17 00:00:00 2001 From: Spacehuhn Date: Wed, 16 Nov 2022 13:23:39 +0100 Subject: [PATCH] Add STRINGLN --- src/duckparser/duckparser.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/duckparser/duckparser.cpp b/src/duckparser/duckparser.cpp index e52c8f3..db4445d 100644 --- a/src/duckparser/duckparser.cpp +++ b/src/duckparser/duckparser.cpp @@ -266,6 +266,24 @@ namespace duckparser { in_string = !line_end; } + // STRING (-> type each character & press enter) + else if (in_string || compare(cmd->str, cmd->len, "STRINGLN", CASE_SENSETIVE)) { + // Type the entire line + if (in_string) { + type(n->str, n->len); + } + // Type the everything after "STRINGLN " + else { + type(line_str, line_str_len); + } + + if(line_end) { + keyboard::pressKey(KEY_ENTER); + release(); + } + + in_string = !line_end; + } // REPEAT (-> repeat last command n times) else if (compare(cmd->str, cmd->len, "REPEAT", CASE_SENSETIVE) || compare(cmd->str, cmd->len, "REPLAY", CASE_SENSETIVE)) { repeat_num = to_uint(line_str, line_str_len) + 1;