Advertisement
Guest User

PoE Patch Update

a guest
Dec 12th, 2019
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.69 KB | None | 0 0
  1. '''
  2. Simple script to launch PoE at a given time.
  3. This will allow the stand-alone client to update.
  4.  
  5. Adjust patch_date, patch_hour and patch_minute to reflect
  6. the correct date/times for the patch release.
  7. '''
  8. import datetime
  9. import os
  10. import time
  11.  
  12. patch_date = '2019-12-13' # Date of the patch
  13. patch_hour = 11 # 24 hour format. Start patching at this hour on the below minute
  14. patch_minute = 5 # Start patching at this minute on the above hour
  15. poe_dir = "C:\\Program Files (x86)\\Grinding Gear Games\\Path of Exile\\" # Double backward slashes necessary
  16. poe_exe = "C:\\Program Files (x86)\\Grinding Gear Games\\Path of Exile\\PathOfExile.exe" # Double backward slashes necessary
  17.  
  18. while True:
  19.     now = str(datetime.datetime.now())
  20.     current_date, current_time = now.split()
  21.     current_hour, current_minute = current_time.split(':')[0], current_time.split(':')[1]
  22.  
  23.     # Check to see if current hour/minute have leadig zeros, remove zero so we can convert to int
  24.     if list(current_hour)[0] == '0':
  25.         current_hour = int(list(current_hour)[1])
  26.     if list(current_minute)[0] == '0':
  27.         current_minute = int(list(current_minute)[1])
  28.    
  29.     # If we are on the correct date and meet/exceed our patch_hours and patch_minutes then we execute PoE to update
  30.     if patch_date in current_date and current_hour >= patch_hour and current_minute >= patch_minute:
  31.         print('PATCH TIME! Launching PoE and exiting this script...')
  32.         os.chdir(poe_dir)
  33.         os.startfile(poe_exe)
  34.         break
  35.     else:
  36.         print("It's only {}! We can't patch until {} {}:{}. Sleeping for 60 seconds and checking again...".format(now, patch_date, patch_hour, patch_minute))
  37.         time.sleep(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement