Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Initialize turtle.
- -- So, I lose a lot of turtles. I drop them by mistake, send them off with programmatic errors that send them into oblivion
- -- or I get distracted by an ore vein and can't find my way back to the turtle.
- -- at any case each time what gets me the most is having to reacquire all my programs.
- -- This init.lua program is intended to just pull all my 'usual' turtle programs, it's intended to be run once to create a
- -- default turtle with the standard tools I like, such as goForward, goUp, goDown, boxmining, etc.
- -- I'm incorporating the update program function so you can also re-run it to bulk update programs for older turtles
- local function updateProgram(pastebinCode, programName)
- print("Starting update process for " .. programName .. "...")
- if fs.exists(programName) then
- print("Deleting old version of " .. programName .. "...")
- fs.delete(programName)
- if not fs.exists(programName) then
- print("Old version deleted successfully.")
- else
- error("Failed to delete old version of " .. programName)
- end
- else
- print("No old version of " .. programName .. " found.")
- end
- print("Downloading new version from Pastebin...")
- local success = shell.run("pastebin", "get", pastebinCode, programName)
- if success then
- print("Successfully downloaded " .. programName .. " from Pastebin.")
- print("Update complete! You can now run " .. programName .. ".")
- else
- error("Failed to download " .. programName .. " from Pastebin. Check the Pastebin code or internet connection.")
- end
- end
- local programName = "boxmining.lua"
- local pastebinCode = "9LGhh30Y"
- updateProgram(pastebinCode, programName)
- local programName = "simp_tree.lua"
- local pastebinCode = "59cssnQ2"
- updateProgram(pastebinCode, programName)
- local programName = "downramp.lua"
- local pastebinCode = "M5w7bYQ1"
- updateProgram(pastebinCode, programName)
- local programName = "clayminer.lua"
- local pastebinCode = "6mKBdMvD"
- updateProgram(pastebinCode, programName)
- local programName = "floor.lua"
- local pastebinCode = "BmpxvsU0"
- updateProgram(pastebinCode, programName)
- local programName = "stairsUp.lua"
- local pastebinCode = "8cAJAG4D"
- updateProgram(pastebinCode, programName)
- local programName = "borethrough.lua"
- local pastebinCode = "NcPPMjSp"
- updateProgram(pastebinCode, programName)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement