Elyspio

pastebin_get

Dec 1st, 2020 (edited)
889
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. local pastebin_url = args[1]
  3. local output = args[2]
  4.  
  5. if pastebin_url == nil or output == nil then
  6.     error("Bad usage : script 'url' 'dest'")
  7. end
  8.  
  9.  
  10. while true do
  11.  
  12.     if fs.exists("./" + output) then
  13.         rm ("./" + output);
  14.     end
  15.     print("Fetching " + pastebin_url + "...")
  16.     shell.run("pastebin", "get", pastebin_url,  output)
  17.  
  18.     os.sleep(1)
  19.  
  20.  
  21. end
  22.  
  23.  
RAW Paste Data