From 332eccc5d4dad98a656697c594df78ce562eae81 Mon Sep 17 00:00:00 2001 From: eejebring Date: Sat, 15 Aug 2026 19:19:33 +0200 Subject: [PATCH] init --- .luarc.json | 13 +++++++++++++ README.md | 7 +++++++ init.lua | 25 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .luarc.json create mode 100644 README.md create mode 100644 init.lua diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..dfe37a2 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,13 @@ +{ + "runtime.version": "Lua 5.1", + "workspace.library": [ + "/home/eejebring/code/external/cc-tweaked-documentation" + ], + "diagnostics.globals": [ + "os", "fs", "computer", "peripheral", "turtle", "term", + "redstone", "colors", "colours", "keys", "http", "gps", + "disk", "commands", "vector", "paintutils", "parallel", + "rs", "settings", "shell", "window", "io", "textutils", + "native", "periphemu", "read" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b10f72e --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Minecraft setup + + +# Dev-setup +for CC-tweaked type notation clone: +`https://gitlab.com/carsakiller/cc-tweaked-documentation.git` +and adjust the `.luarc.json` file to point to it's install location. diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..837cd71 --- /dev/null +++ b/init.lua @@ -0,0 +1,25 @@ +local options = { "left", "control", "right" } +local prompt = "What computer is to be setup? select: (" .. table.concat(options, " ") .. ") with up/down arrows" +io.output("settings.json") + +function table.contains(table, element) + for _, value in pairs(table) do + if value == element then + return true + end + end + return false +end + +function setup(role) + local jsonOutput = textutils.serialiseJSON({ ["role"] = role }) + io.write(jsonOutput) +end + +while true do + print(prompt) + local input = read(nil, options) + if table.contains(options, input) then + setup(input) + end +end