Advertisement
Guest User

funscript_delayer.py

a guest
Sep 6th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import json
  2. import sys
  3.  
  4. FILE = sys.argv[1]
  5. DELAY = int(sys.argv[2])
  6.  
  7. file = open(FILE, "r")
  8. data = json.loads(file.read())
  9.  
  10. for action in data["actions"]:
  11.     action["at"] += DELAY
  12.  
  13. if "rawActions" in data:
  14.     for action in data["rawActions"]:
  15.         action["at"] += DELAY
  16.        
  17. open(FILE, "w").write(json.dumps(data, separators=(',',':')))
  18.  
  19. print("Done, " + str(len(data["actions"])) + " changes made")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement