ROMVoid

Untitled

Jan 22nd, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. --Setup
  2. local tArgs = {...}
  3. local program = shell.getRunningProgram()
  4.  
  5.  
  6. if #tArgs < 2 then
  7. print("Usage: "..program.." <code> <save-file-name>")
  8. print("The code must not contain the . with more random letters after it.")
  9. else
  10.  
  11. --Variables
  12. local fileA = tArgs[2]
  13. local http1 = http.get("https://haste.romvoid.dev/raw/"..tArgs[1])
  14. local http2 = http1.readAll()
  15. local file = fs.open(tostring(fileA), "w")
  16.  
  17.  
  18.  
  19. --Functions
  20. local function clear()
  21. term.clear()
  22. term.setCursorPos(1,1)
  23. end
  24.  
  25. local function main()
  26. file.write(http2)
  27. file.close()
  28. print("Success")
  29. return nil
  30. end
  31.  
  32. --Execution (very simple)
  33. main()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment