Advertisement
guitarplayer616

BlueprintMarket WIP

Jan 11th, 2017
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --upload to Market
  2. tArgs = {...}
  3. shell.run("clr")
  4.  
  5. if #tArgs == 1 then
  6.     print("Usage = market upload [file]")
  7. end
  8.  
  9. if not fs.exists("blueprints") then
  10.     fs.makeDir("blueprints")
  11. end
  12.  
  13. --[[
  14. if not fs.exists("convert") then
  15.     shell.run("pastebin get NUspW9KB convert")
  16. end
  17. ]]
  18.  
  19. local files = {
  20.  
  21.     chicken = "VisRJwkw",
  22.    
  23.  
  24. }
  25.  
  26. if tArgs[1] == "upload" then
  27.     if fs.exists("sSchematic") then
  28.         fs.delete("sSchematic")
  29.     end
  30.     -- shell.run("convert toStringFile "..tArgs[2].." sSchematic")
  31.     shell.run("pastebin put sSchematic")
  32.  
  33.  
  34. else
  35.     for i,v in pairs(files) do
  36.         local w = fs.open("blueprints/"..i,"w")
  37.         w.write([[
  38.             local schem = http.get("http://pastebin.com/raw/]]..v..[[").readAll()
  39.             local h = fs.open("temp","w")
  40.             h.write(schem)
  41.             h.close()
  42.             shell.run("convert toByteFile temp ]]..i..[[")
  43.             if fs.exists("temp") then
  44.                 fs.delete("temp")
  45.             end
  46.         ]])
  47.         w.close()
  48.     end
  49.    
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement