Advertisement
Marlingaming

Frame Video Player

Apr 5th, 2022 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. local tArg = {...}
  2.  
  3. local Path = tArg[1]
  4. local X = textutils.unserialize(tArg[2])
  5. local Y = textutils.unserialize(tArg[3])
  6.  
  7. local FrameRate = 1
  8. local Frames = {}
  9.  
  10. local file = fs.open(Path,"r")
  11. FrameRate = textutils.unserialize(file.readLine())
  12. local Content
  13. local I = 1
  14. Frames[I] = file.readLine()
  15. while true do
  16. Content = file.readLine()
  17. if Content ~= nil then
  18. if Content == "frameEnd" then
  19. I = I + 1
  20. Frames[I] = file.readLine()
  21. else
  22. Frames[I] = Frames[I].."\n"
  23. Frames[I] = Frames[I]..Content
  24. end
  25. end
  26. if Content == nil then break end
  27. end
  28. file.close()
  29. for i = 1, I do
  30. local Image = paintutils.parseImage(Frames[i])
  31. paintutils.drawImage(Image,X,Y)
  32. os.sleep(FrameRate)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement