import os import time import re print("Keep window open for automatic refresh every 30 seconds. 30 second wait is to prevent high cpu usage by having it search through all vrc log files in the past 24 hours multiple times a second") # ALL CODE WRITTEN USING chat.openai.com # I am not good at coding all I can really do is just look at code and modify it # This script will create a file called "instance history.html" in the same directory as the script. while True: # Get the path to the VRChat directory appdata_dir = os.getenv('AppData') vrchat_dir = os.path.join(appdata_dir, '..', 'LocalLow', 'VRChat', 'VRChat') # Get a list of all the files in the VRChat directory files = os.listdir(vrchat_dir) # Filter the list to include only .txt files txt_files = [f for f in files if f.endswith('.txt')] # Sort the list of .txt files by last modified date (oldest first) txt_files.sort(key=lambda x: os.stat(os.path.join(vrchat_dir, x)).st_mtime, reverse=False) # Create a new file to write the output to output_file = open('instance history.html', 'w', encoding='utf-8') output_file.write('\n') output_file.write('
\n') output_file.write('Time | \n') output_file.write('Instance | \n') output_file.write('|
---|---|---|
' + line[1:17] + ' | \n') output_string = line[line.index('[Behaviour] Joining'):].replace('[Behaviour] Joining', '').replace('or Creating Room:', '') # Extract the world ID and instance ID from the output string world_id_match = re.search(r'wrld_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', output_string) world_id = world_id_match.group() if world_id_match else '' instance_id = output_string[output_string.index(':') + 1:] if ':' in output_string else '' # Construct the link link = f"https://vrchat.com/home/launch?worldId={world_id}&instanceId={instance_id}" # Create the HTML link html_link = f"{output_string}" if 'wrld_' in output_string: output_file.write('' + html_link + ' | \n') else: output_file.write('' + output_string + ' | \n') output_file.write('