gghf

ExcavateInit

Jul 14th, 2022 (edited)
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  2. -- 1. run 'pastebin get 6Ygb1pZp ExcavateInit' IN THE ROOT DIRECTORY to download this file
  3. -- 2. run 'ExcavateInit'
  4. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  5.  
  6. -- HB810Utu collect
  7. -- W2qVHGc2 doRefuel
  8. -- mzj74X2b goTo
  9. -- kUWkUJzu main
  10. -- qxskVVdf returnSupplies
  11. -- PuQxFFKz tryDown
  12. -- NXnxqmUZ tryForwards
  13. -- dURixY5G turn
  14. -- xW8BM9Rc unload
  15.  
  16. -- create/set directory for modules of this program
  17. local workDir = "/excavate"
  18. local intent
  19.  
  20. print("\nWhat would you like to do?: <run> to run / <inst> to install or reinstall.")
  21. intent = io.read()
  22. if intent == "run" then
  23.  
  24.     shell.setDir(workDir)
  25.     shell.run("main")
  26.  
  27. elseif intent == "inst" then
  28.     if fs.exists(workDir) then
  29.         print("\nThe directory '/excavate' already exists. Would you like to delete it? y/n:")
  30.  
  31.         local userInput = io.read()
  32.  
  33.         if userInput == "y" then
  34.             fs.delete(workDir)
  35.             print("\n\tdeleted preexisting directory: " .. workDir)
  36.         else
  37.             shell.setDir("/")
  38.             error("Did NOT delete preexisting directory. Aborting.")
  39.         end
  40.     end
  41.  
  42.     fs.makeDir(workDir)
  43.     print("\tDirectory created: " .. workDir)
  44.     shell.setDir(workDir)
  45.  
  46.     -- download all modules of "Excavate" into the directory created above
  47.     shell.run("/rom/programs/http/pastebin get HB810Utu collect")
  48.     shell.run("/rom/programs/http/pastebin get W2qVHGc2 doRefuel")
  49.     shell.run("/rom/programs/http/pastebin get mzj74X2b goTo")
  50.     shell.run("/rom/programs/http/pastebin get kUWkUJzu main")
  51.     shell.run("/rom/programs/http/pastebin get qxskVVdf returnSupplies")
  52.     shell.run("/rom/programs/http/pastebin get PuQxFFKz tryDown")
  53.     shell.run("/rom/programs/http/pastebin get NXnxqmUZ tryForwards")
  54.     shell.run("/rom/programs/http/pastebin get dURixY5G turn")
  55.     shell.run("/rom/programs/http/pastebin get xW8BM9Rc unload")
  56.  
  57.     -- execute
  58.     shell.run("main")
  59.  
  60. else
  61.     error("invalid input")
  62. end
  63.  
Advertisement
Add Comment
Please, Sign In to add comment