Skip to content

Commit

Permalink
Merge pull request #2 from HongGong232/HongGong232-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
LXanii authored Dec 17, 2022
2 parents 071942f + ab5c9ea commit 37730c0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 21 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Geometry Dash Optimizer

This program automatically sets Geometry Dash to High Priority, and Discord to Low Priority.
As more optimizes are found, they will be added so make sure to keep up to date, will post updates on Twitter as well.

OPEN THIS PROGRAM ONLY AFTER OPENING GD AND DISCORD.

"main.py" is the source code for the executable. "GD_Optimizer.exe" should work for everyone without the requirement of Python.

# Working Operating Systems

Windows 11,
Windows 10

This list will be updated with more operating systems that are confirmed to work.

# Important

Relaunch the program everytime you join a new call on discord.
# Geometry Dash Optimizer

This program automatically sets Geometry Dash to High Priority, and Discord to Low Priority.
As more optimizes are found, they will be added so make sure to keep up to date, will post updates on Twitter as well.

OPEN THIS PROGRAM ONLY AFTER OPENING GD AND DISCORD.

"main.py" is the source code for the executable. "GD_Optimizer.exe" should work for everyone without the requirement of Python.

# Working Operating Systems

Windows 11,
Windows 10

This list will be updated with more operating systems that are confirmed to work.

# Important

Relaunch the program everytime you join a new call on discord.
32 changes: 30 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import os
import time
import shutil

folder = 'C:/Users/'+os.getlogin()+'/AppData/Local/Temp'

deleteFileCount = 0
deleteFolderCount = 0

big_ver = "1"
mini_ver = ".1.0"
version = "(" + big_ver + mini_ver + ")"

"""
Priority Level Value Priority Level Name
256 Realtime
128 High
32768 Above normal
Expand Down Expand Up @@ -58,6 +63,29 @@ def process():
return("All processes set correctly.")

print("\033[1;37;40mGD Optimizer Version", version , "\n\033[1;31;40mWarning: You will need to relaunch \nthis everytime you open GD, or join a new discord call.", "\033[1;37;40m\n" + process())
print("Running Temp Cleaner...")
time.sleep(3)

for the_file in os.listdir(folder):
file_path = os.path.join(folder, the_file)
indexNo = file_path.find('\\')
itemName = file_path[indexNo+1:]
try:
if os.path.isfile(file_path):
os.unlink(file_path)
print( '%s file deleted' % itemName )
deleteFileCount = deleteFileCount + 1

elif os.path.isdir(file_path):
if file_path.__contains__('chocolatey'): continue
shutil.rmtree(file_path)
print( '%s folder deleted' % itemName )
deleteFolderCount = deleteFolderCount + 1

except Exception as e:
print('Access Denied: %s' % itemName )

print(str(deleteFileCount)+' files and '+ str(deleteFolderCount)+' folders deleted.')
time.sleep(1)
print("Closing in 5 seconds...")
time.sleep(5)
time.sleep(5)

0 comments on commit 37730c0

Please sign in to comment.