Advertisement
Ubidibity

init.lua

Apr 30th, 2025 (edited)
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.33 KB | Gaming | 0 0
  1. -- Initialize turtle.
  2. -- So, I lose a lot of turtles.  I drop them by mistake, send them off with programmatic errors that send them into oblivion
  3. -- or I get distracted by an ore vein and can't find my way back to the turtle.
  4. -- at any case each time what gets me the most is having to reacquire all my programs.
  5. -- This init.lua program is intended to just pull all my 'usual' turtle programs, it's intended to be run once to create a
  6. -- default turtle with the standard tools I like, such as goForward, goUp, goDown, boxmining, etc.
  7. -- I'm incorporating the update program function so you can also re-run it to bulk update programs for older turtles
  8.  
  9.  
  10. local function updateProgram(pastebinCode, programName)
  11.   print("Starting update process for " .. programName .. "...")
  12.   if fs.exists(programName) then
  13.     print("Deleting old version of " .. programName .. "...")
  14.     fs.delete(programName)
  15.     if not fs.exists(programName) then
  16.       print("Old version deleted successfully.")
  17.     else
  18.       error("Failed to delete old version of " .. programName)
  19.     end
  20.   else
  21.     print("No old version of " .. programName .. " found.")
  22.   end
  23.  
  24.   print("Downloading new version from Pastebin...")
  25.   local success = shell.run("pastebin", "get", pastebinCode, programName)
  26.   if success then
  27.     print("Successfully downloaded " .. programName .. " from Pastebin.")
  28.     print("Update complete! You can now run " .. programName .. ".")
  29.   else
  30.     error("Failed to download " .. programName .. " from Pastebin. Check the Pastebin code or internet connection.")
  31.   end
  32. end
  33.  
  34. local programName = "boxmining.lua"
  35. local pastebinCode = "9LGhh30Y"
  36. updateProgram(pastebinCode, programName)
  37.  
  38. local programName = "simp_tree.lua"
  39. local pastebinCode = "59cssnQ2"
  40. updateProgram(pastebinCode, programName)
  41.  
  42. local programName = "downramp.lua"
  43. local pastebinCode = "M5w7bYQ1"
  44. updateProgram(pastebinCode, programName)
  45.  
  46. local programName = "clayminer.lua"
  47. local pastebinCode = "6mKBdMvD"
  48. updateProgram(pastebinCode, programName)
  49.  
  50. local programName = "floor.lua"
  51. local pastebinCode = "BmpxvsU0"
  52. updateProgram(pastebinCode, programName)
  53.  
  54. local programName = "stairsUp.lua"
  55. local pastebinCode = "8cAJAG4D"
  56. updateProgram(pastebinCode, programName)
  57.  
  58. local programName = "borethrough.lua"
  59. local pastebinCode = "NcPPMjSp"
  60. updateProgram(pastebinCode, programName)
  61.  
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement