From 2b8874ba63394634d23fa959523dd544c85f5d38 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Sat, 17 Dec 2022 16:35:11 +0100 Subject: [PATCH] improved install script. --- install.lua | 15 ++++++++++++++- itemscript.lua | 2 ++ movescript.lua | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/install.lua b/install.lua index f059ac1..3e7fe6b 100644 --- a/install.lua +++ b/install.lua @@ -7,4 +7,17 @@ to run the installer on your device. BASE_URL = "https://github.com/andrewlalis/movescript/blob/main" -shell.run("wget " .. BASE_URL .. "/movescript.lua") +SCRIPTS = { + "movescript.lua", + "itemscript.lua" +} + +-- Create a local executable to re-install, instead of having to run this file via wget. +local f = io.open("install-movescript.lua", "w") +for _, script in pairs(SCRIPTS) do + url = BASE_URL .. "/" .. script + cmd = "wget " .. url .. " " .. script + shell.run(cmd) + f:write("shell.run(\"" .. cmd .. "\")") +end +f:close() diff --git a/itemscript.lua b/itemscript.lua index 0a0f9a6..de5f219 100644 --- a/itemscript.lua +++ b/itemscript.lua @@ -5,6 +5,8 @@ Author: Andrew Lalis ]]-- +VERSION = "0.0.1" + local t = turtle -- The itemscript module. Functions defined within this table are exported. diff --git a/movescript.lua b/movescript.lua index 03db8d3..bc4c4bd 100644 --- a/movescript.lua +++ b/movescript.lua @@ -7,6 +7,8 @@ Movescript provides a simpler, conciser way to program "turtles" (robots), so that you don't need to get tired of typing "turtle.forward()" over and over. ]]-- +VERSION = "0.0.1" + local t = turtle -- The movescript module. Functions defined within this table are exported.