Advertisement
Joshalot

CC - pastebinPlus

Jan 26th, 2021 (edited)
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. -- pastebin get 3v5Qsfkb pp
  2. --------------------------------------------------
  3.  
  4. --[[
  5.     pastebin get CODE NAME
  6.     pastebin put NAME
  7.     pastebin run CODE ARGS
  8. ]]
  9.  
  10. args = {...}
  11. action = args[1]
  12. arg1 = args[2]
  13. arg2 = args[3]
  14. force = args[4]
  15.  
  16. if action == 'get' and arg1 ~= nil then
  17.     if fs.exists(arg2) then
  18.         if force ~= '-f' then
  19.             print('This file already exists.')
  20.             print('Do you want to overide it? (y/n)')
  21.             answer = read()
  22.             if answer ~= 'y' then
  23.                 return
  24.             end
  25.         end
  26.         fs.delete(arg2)
  27.     end
  28.     shell.run("pastebin", "get", arg1, arg2)
  29. elseif action == 'put' and arg1 ~= nil then
  30.     shell.run("pastebin", "put", arg1)
  31. elseif action == 'run' and arg1 ~= nil then
  32.     shell.run("pastebin", "run", arg1, arg2)
  33. else
  34.     print('Usages:')
  35.     print('pp get <code> <filename>')
  36.     print('pp put <filename>')
  37.     print('pp run <code> <arguments>')
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement