Bmorr

loader.lua

Dec 21st, 2020 (edited)
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. --[[
  2. pastebin get AM7K54ri strip_mine.lua
  3.  
  4. --]]
  5.  
  6.  
  7. -- Process args
  8. local tArgs = { ... }
  9. if not (#tArgs >= 1) then
  10.     local programName = arg[0] or fs.getName(shell.getRunningProgram())
  11.     print("Usage: " .. programName .. " <length> Optional: <debugMode>")
  12.     return
  13. end
  14.  
  15. local length = tonumber(tArgs[1])
  16. if length < 0 then
  17.     print("Tunnel length must be positive or zero")
  18.     return
  19. end
  20.  
  21. local debugMode = ""
  22. if #tArgs == 2 then
  23.     print("DebugMode Active")
  24.     debugMode = 1
  25. end
  26.  
  27. -- config.txt
  28. if fs.exists("config.txt") then
  29.     fs.delete("config.txt")
  30. end
  31. shell.run("pastebin get 1FcmHrkr config.txt")
  32. -- strip_mine.lua updater
  33. if fs.exists(".strip_mine.lua") then
  34.     fs.delete(".strip_mine.lua")
  35. end
  36. shell.run("pastebin get Uimcvayy .strip_mine.lua")
  37.  
  38. shell.run(".strip_mine.lua "..arg[1].." "..debugMode)
  39.  
  40. print("This will load", tonumber(arg[1]) / 16, "chunks")
  41.  
Advertisement
Add Comment
Please, Sign In to add comment