theinsekt

downloader

Feb 20th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. -- arguments to this program
  2. args={...}
  3.  
  4. -- the list of files to download
  5. -- just comment out unwanted files
  6. local files={
  7. Zxq2nufC="turtle2",
  8. RCZZdjY6="mine1",
  9. --example="crap",
  10. Ciy9Kr0S="mine2",
  11. t25VtYDj="test",
  12. CD9xJQfw="m",
  13. CBaVH9S3="mine3",
  14. HeUAUZ9r="test2",
  15. aQ1JNKKT="stairs",
  16. WhRQ9tYj="mineVein",
  17. ["1RggZRdC"]="position",--have to do like this if code starts with number
  18. U1yQYHR4="veinMiner",
  19. Dg5hkDtJ="mineMaterials",
  20. 0DmRkc4J="mine1v2",
  21. }
  22.  
  23. -- the folder to download the files to
  24. local folder="/theinsekt"
  25.  
  26. -- delete folder if first argument is "rm"
  27. if #args==1 then
  28.   if args[1]=="rm" then
  29.    fs.delete(folder)
  30.   end --if
  31. end --if
  32.  
  33.  
  34. -- make the folder
  35. fs.makeDir(folder)
  36.  
  37. -- download files
  38. for code, filename in pairs(files) do
  39.   shell.run("pastebin","get", code, folder.."/"..filename)
  40. end --for
Add Comment
Please, Sign In to add comment