From 1d33c2fcc04983f75b202b43bcd759e4369742b1 Mon Sep 17 00:00:00 2001 From: Matthieu Jolimaitre Date: Wed, 15 May 2024 01:55:58 +0200 Subject: [PATCH 1/2] add autorun script --- cc-tweaked/scripts/autorun.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cc-tweaked/scripts/autorun.lua diff --git a/cc-tweaked/scripts/autorun.lua b/cc-tweaked/scripts/autorun.lua new file mode 100644 index 0000000..1164508 --- /dev/null +++ b/cc-tweaked/scripts/autorun.lua @@ -0,0 +1,31 @@ +os.run = os.run +os.sleep = os.sleep + +function table.slice(tbl, first, last) + local result = {} + for i = first or 1, last or #tbl do + result[#result + 1] = tbl[i] + end + return result +end + +local program = ... +local args = table.slice(arg, 1) + +local function main() + if program == nil then + print("Usage: autorun [...args]") + return + end + + local i = 0 + while true do + i = i + 1 + os.run({}, "/update", program) + os.run({}, program, table.unpack(args)) + print("autorun", i) + os.sleep(1) + end +end + +main() From 59c9c151ce1f0d7c6be4661c6b382f92c9509e84 Mon Sep 17 00:00:00 2001 From: Matthieu Jolimaitre Date: Wed, 15 May 2024 01:56:12 +0200 Subject: [PATCH 2/2] update ide settings --- .vscode/settings.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index cbac569..dbbd753 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,7 @@ { - "deno.enable": true + "deno.enable": true, + "Lua.diagnostics.globals": [ + "fs", + "http" + ] }