SHARE
TWEET

splits.py

a guest Nov 8th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2. import sys
  3. import time
  4. import datetime
  5. import subprocess
  6. import pynput
  7. from pynput.keyboard import Key, Controller
  8. screenshotsfolder = 'C:\\Program Files (x86)\\World of Warcraft\\_classic_\\Screenshots'
  9.  
  10. def activeScanner():
  11.     initial_run_time = time.time()
  12.     data = {}
  13.     keyboard = Controller()
  14.     try:
  15.         while True:
  16.             for file in os.listdir(screenshotsfolder):
  17.                 if file.startswith("WoWScrnShot_") and file.endswith(".jpg"):
  18.                     fndtstr =  file.replace("WoWScrnShot_",'').replace(".jpg",'')
  19.                     fndt = time.mktime(datetime.datetime.strptime(fndtstr, "%m%d%y_%H%M%S").timetuple())
  20.                     if fndt not in data.keys():
  21.                         if fndt > initial_run_time:
  22.                             data[fndt]=fndtstr
  23.                             keyboard.press(Key.home)
  24.                         else:
  25.                             #not from this session, ignore
  26.                             pass
  27.                     else:
  28.                         #already know about it, ignore
  29.                         pass
  30.     except KeyboardInterrupt:
  31.         pass
  32. def main():
  33.     activeScanner()
  34. if __name__ == '__main__':
  35.     main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top