download.lua
58 lines · 2.0 KB
Install eDig system in eDig folder
Copy & run
wget https://perlytiara.github.io/turtles.tips/raw/programs/perlytiara/eDig/download.lua
| 1 | -- download.lua - Install eDig system in eDig folder |
| 2 | print("Installing eDig system...") |
| 3 | |
| 4 | local files = { |
| 5 | edig = "https://raw.githubusercontent.com/perlytiara/CC-Tweaked-TurtsAndComputers/refs/heads/main/programs/perlytiara/eDig/edig.lua", |
| 6 | client = "https://raw.githubusercontent.com/perlytiara/CC-Tweaked-TurtsAndComputers/refs/heads/main/programs/perlytiara/eDig/client.lua", |
| 7 | multi = "https://raw.githubusercontent.com/perlytiara/CC-Tweaked-TurtsAndComputers/refs/heads/main/programs/perlytiara/eDig/multi.lua", |
| 8 | startup = "https://raw.githubusercontent.com/perlytiara/CC-Tweaked-TurtsAndComputers/refs/heads/main/programs/perlytiara/eDig/startup.lua", |
| 9 | update = "https://raw.githubusercontent.com/perlytiara/CC-Tweaked-TurtsAndComputers/refs/heads/main/programs/perlytiara/eDig/update.lua" |
| 10 | } |
| 11 | |
| 12 | local function downloadFile(url, filename) |
| 13 | print("Downloading " .. filename .. "...") |
| 14 | local result = shell.run("wget", url, filename) |
| 15 | if result then |
| 16 | print("✓ " .. filename) |
| 17 | return true |
| 18 | else |
| 19 | print("✗ Failed to download " .. filename) |
| 20 | return false |
| 21 | end |
| 22 | end |
| 23 | |
| 24 | -- Create eDig directory if it doesn't exist |
| 25 | if not fs.exists("eDig") then |
| 26 | fs.makeDir("eDig") |
| 27 | end |
| 28 | |
| 29 | local success = 0 |
| 30 | |
| 31 | -- Download all files to eDig directory |
| 32 | for name, url in pairs(files) do |
| 33 | if downloadFile(url, "eDig/" .. name) then |
| 34 | success = success + 1 |
| 35 | end |
| 36 | end |
| 37 | |
| 38 | -- Setup startup file for turtles (in root directory) |
| 39 | if turtle then |
| 40 | if downloadFile(files.startup, "startup") then |
| 41 | success = success + 1 |
| 42 | end |
| 43 | else |
| 44 | print("- startup (not a turtle)") |
| 45 | end |
| 46 | |
| 47 | print("Installed " .. success .. " files") |
| 48 | |
| 49 | if turtle then |
| 50 | print("Turtle setup complete!") |
| 51 | print("Run 'eDig/client' to start listening for jobs") |
| 52 | print("Or run 'eDig/edig dig <height> <length> <width> [place] [segment] [shape]' directly") |
| 53 | print("Run 'eDig/update' to update all files") |
| 54 | else |
| 55 | print("Computer setup complete!") |
| 56 | print("Run 'eDig/multi' to send jobs to turtles") |
| 57 | print("Run 'eDig/update' to update all files") |
| 58 | end |