Advertisement
melzneni

Turti simple installer

Aug 14th, 2023 (edited)
1,158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. local args = { ... }
  2.  
  3. if #args < 1 then
  4.     error("Please provide a turti-program pastebin id")
  5. end
  6. local restartOnError = false
  7. if #args > 1 then
  8.     if args[2] == "restartOnError" then
  9.         restartOnError = true
  10.     else
  11.         error("unknown argument" .. args[2])
  12.     end
  13. end
  14.  
  15. local librariesFiles = ""
  16. local librariesArg = ""
  17. --[[if #args > 1 then
  18.     librariesArg = ",'libraries=["
  19.     for i = 2, #args do
  20.         librariesFiles = librariesFiles .. "," .. "lib" .. (i - 1) .. "=<pb:" .. args[i] .. ">"
  21.         if i > 2 then
  22.             librariesArg = librariesArg .. ","
  23.         end
  24.         librariesArg = librariesArg .. "'lib" .. (i - 1) .. "'"
  25.     end
  26.     librariesArg = librariesArg .. "]'"
  27. end]]
  28.  
  29. local cmd = "startup={files=" ..
  30.         "{turti=<pb:wWfEzVYN>,core=<pb:XR1thET5>,std=<pb:QRVgewvP>,DFE=<pb:ct5uJunh>" .. librariesFiles .. ",program.turti=<pb:" .. args[1] .. ">}," ..
  31.         "delay=0," ..
  32.         "cmds={{'core','program.turti'" .. librariesArg .. ",'restartOnError=" .. tostring(restartOnError) .. "',$arg1$,$arg2$}}} reboot=true"
  33.  
  34. shell.run("pastebin", "run", "ptz9M5PM", cmd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement