Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Revamped Valorant Optimization and added Apex Legends one
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckDuckG0ose committed Oct 28, 2023
1 parent c3e7c52 commit c4c8097
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from modules import maximize_command_prompt, boostdiscord, webbrowser, iprenew, spicetify, mssuninstall, run_robloxtweaks_cmd, windowssearch, smartscreen
from modules import defrag
import json
from apex import apextweaks
from debloat import debloat
from servicetweak import servicetweak
from powerplan import powerplan
Expand Down Expand Up @@ -384,6 +385,8 @@ def gametweaks():
tweakval()
elif action == 3:
minecraft_tweak()
elif action == 4:
apextweaks()
elif action == 99:
break
else:
Expand Down
49 changes: 49 additions & 0 deletions apex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import os
import configparser
import ctypes

def apextweaks():
# The default directory for Apex Legends settings.cfg file
default_dir = os.path.expanduser("~\\Saved Games\\Respawn\\Apex\\local")

# Check if the directory exists
if not os.path.exists(default_dir):
print("The default directory does not exist. Please make sure Apex Legends is installed correctly.")
return

# Path to the settings.cfg file
config_path = os.path.join(default_dir, "settings.cfg")

# Check if the settings.cfg file exists
if not os.path.isfile(config_path):
print("The settings.cfg file does not exist in the default directory.")
return

# Ask for user confirmation
MessageBox = ctypes.windll.user32.MessageBoxW
result = MessageBox(None, 'Are you sure you want to lower the Apex Legends settings for better performance?', 'Confirmation', 1)
if result == 1:
# Create a config parser object
config = configparser.ConfigParser()
config.read(config_path)

# Lower the settings
if 'VideoConfig' in config:
config['VideoConfig']['setting.cl_gib_allow'] = '0'
config['VideoConfig']['setting.cl_particle_fallback_base'] = '0'
config['VideoConfig']['setting.cl_particle_fallback_multiplier'] = '0'
config['VideoConfig']['setting.cl_ragdoll_maxcount'] = '0'
config['VideoConfig']['setting.mat_depthfeather_enable'] = '0'
config['VideoConfig']['setting.mat_forceaniso'] = '1'
config['VideoConfig']['setting.particle_cpu_level'] = '0'
config['VideoConfig']['setting.r_createmodeldecals'] = '0'
config['VideoConfig']['setting.r_decals'] = '0'
config['VideoConfig']['setting.shadow_enable'] = '0'

# Save the changes back to the file
with open(config_path, 'w') as configfile:
config.write(configfile)

print("The settings have been successfully lowered for better performance.")
else:
print("Operation cancelled by user.")

0 comments on commit c4c8097

Please sign in to comment.