Joshalot

CC - pastebinPlus

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