SanyaRamzik

paste.lua

Sep 16th, 2020
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. -- paste.lua
  2. local shell=require("shell")
  3. local os=require("os")
  4.  
  5. local args, ops = shell.parse(...)
  6.  
  7. if #args==0 then
  8.   io.write("paste [link-code] [filename]")
  9. elseif args[2]==nil then
  10.   io.write("link-code: "..args[1].." | filename: "..args[1].."\n")
  11.   print("########")
  12.   local str="wget -f https://pastebin.com/raw/"..args[1].." "..args[1]
  13.   os.execute(str)
  14. elseif args[2]~=nil then
  15.   io.write("link-code: "..args[1].." | filename: "..args[2].."\n")
  16.   print("########")
  17.   local str="wget -f https://pastebin.com/raw/"..args[1].." "..args[2]
  18.   os.execute(str)
  19. end
Add Comment
Please, Sign In to add comment