Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Simple script to launch PoE at a given time.
- This will allow the stand-alone client to update.
- Adjust patch_date, patch_hour and patch_minute to reflect
- the correct date/times for the patch release.
- '''
- import datetime
- import os
- import time
- patch_date = '2019-12-13' # Date of the patch
- patch_hour = 11 # 24 hour format. Start patching at this hour on the below minute
- patch_minute = 5 # Start patching at this minute on the above hour
- poe_dir = "C:\\Program Files (x86)\\Grinding Gear Games\\Path of Exile\\" # Double backward slashes necessary
- poe_exe = "C:\\Program Files (x86)\\Grinding Gear Games\\Path of Exile\\PathOfExile.exe" # Double backward slashes necessary
- while True:
- now = str(datetime.datetime.now())
- current_date, current_time = now.split()
- current_hour, current_minute = current_time.split(':')[0], current_time.split(':')[1]
- # Check to see if current hour/minute have leadig zeros, remove zero so we can convert to int
- if list(current_hour)[0] == '0':
- current_hour = int(list(current_hour)[1])
- if list(current_minute)[0] == '0':
- current_minute = int(list(current_minute)[1])
- # If we are on the correct date and meet/exceed our patch_hours and patch_minutes then we execute PoE to update
- if patch_date in current_date and current_hour >= patch_hour and current_minute >= patch_minute:
- print('PATCH TIME! Launching PoE and exiting this script...')
- os.chdir(poe_dir)
- os.startfile(poe_exe)
- break
- else:
- print("It's only {}! We can't patch until {} {}:{}. Sleeping for 60 seconds and checking again...".format(now, patch_date, patch_hour, patch_minute))
- time.sleep(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement