-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobloxCursorChanger_CommandApplication.py
82 lines (79 loc) · 4.2 KB
/
RobloxCursorChanger_CommandApplication.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import os
import colorama
import time
import sys
import argparse
from colorama import Back,Fore,Style
colorama.init(autoreset=True)
if os.name != 'nt':
print(f'{Fore.YELLOW}Warning! This is a windows os only scipt. \nYou are NOT running windows!\nThis script will exit in 10 seconds.')
time.sleep(10)
sys.exit()
def resolve_file_path(file_path):
if not os.path.isabs(file_path):
file_path = os.path.join(os.getcwd(), file_path)
file_path = os.path.abspath(file_path)
return file_path
with open("version.txt", "r") as f:
version = f.read()
parser = argparse.ArgumentParser()
parser.add_argument('--fileone', '-f1', help='Specify first cursor file', default='ArrowCursor.png')
parser.add_argument('--filetwo', '-f2', help='Specify second cursor file', default='ArrowFarCursor.png')
parser.add_argument('--remove', '-r', help='Remove empty version folders', default='n', action='store_true')
parser.add_argument('--version', '-v', help='Show version', action='version', version=version)
args = parser.parse_args()
print(fr'{Fore.LIGHTCYAN_EX} ________ ________ ___ _____ ______ ___ ________ ________ _______ ')
time.sleep(0.1)
print(fr'{Fore.LIGHTCYAN_EX}|\ ____\|\_____ \|\ \|\ _ \ _ \|\ \|\ __ \|\ ___ \|\ ___ \ ')
time.sleep(0.1)
print(fr'{Fore.CYAN}\ \ \___|_\|___/ /\ \ \ \ \\\__\ \ \ \ \ \ \|\ \ \ \\ \ \ \ __/| ')
time.sleep(0.1)
print(fr'{Fore.CYAN} \ \_____ \ / / /\ \ \ \ \\|__| \ \ \ \ \ \\\ \ \ \\ \ \ \ \_|/__ ')
time.sleep(0.1)
print(fr'{Fore.LIGHTBLUE_EX} \|____|\ \ / /_/__\ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \\ \ \ \ \_|\ \ ')
time.sleep(0.1)
print(fr'{Fore.LIGHTBLUE_EX} ____\_\ \\________\ \__\ \__\ \ \__\ \__\ \_______\ \__\\ \__\ \_______\ ')
time.sleep(0.1)
print(fr'{Fore.BLUE} |\_________\|_______|\|__|\|__| \|__|\|__|\|_______|\|__| \|__|\|_______|')
time.sleep(0.1)
print(fr'{Fore.BLUE} \|_________| ')
time.sleep(0.1)
print(fr'{Fore.LIGHTRED_EX} ___ _ _ _ ')
time.sleep(0.1)
print(fr'{Fore.LIGHTRED_EX} | _ \___| |__| |_____ __ __ _ _ _ _ ___ ___ _ _ __| |_ __ _ _ _ __ _ ___ _ _ ')
time.sleep(0.1)
print(fr"{Fore.LIGHTRED_EX} | / _ \ '_ \ / _ \ \ / / _| || | '_(_-</ _ \ '_| / _| ' \/ _` | ' \/ _` / -_) '_|")
time.sleep(0.1)
print(fr'{Fore.RED} |_|_\___/_.__/_\___/_\_\ \__|\_,_|_| /__/\___/_| \__|_||_\__,_|_||_\__, \___|_| ')
time.sleep(0.1)
print(fr'{Fore.RED} |___/ ')
time.sleep(0.1)
print(f'{Fore.LIGHTYELLOW_EX}You are using a Command Line Application of this script. For help run the script with --help or -h.\n This scipt is more cutomizable. If you wish to run the normal one sipmly run \'RobloxCursorChanger.py\'')
fileone = resolve_file_path(args.fileone)
filetwo = resolve_file_path(args.filetwo)
os.chdir(os.path.expandvars(r'%localappdata%\Roblox\Versions'))
folders = [name for name in os.listdir() if os.path.isdir(os.path.join(os.getcwd(), name))]
print(f'{Fore.CYAN}Found {len(folders)} folders')
for folder in folders:
print(f'{Fore.CYAN}Checking for roblox files in {folder}')
os.chdir(os.path.expandvars(folder))
things_in_path = os.listdir()
if 'content' in things_in_path:
if 'StudioFonts' in os.listdir():
os.chdir(os.path.expandvars(r'..'))
print(f'{Fore.RED} Ignoring Roblox Studio in {folder}...')
else:
print(f'{Fore.GREEN}Found roblox files in {os.getcwd()}')
os.chdir(os.path.expandvars(r'content\textures'))
os.system(f"xcopy {fileone} Cursors\\KeyboardMouse\\ArrowCursor.png /Y >nul")
os.system(f"xcopy {filetwo} Cursors\\KeyboardMouse\\ArrowFarCursor.png /Y >nul")
print(f'{Fore.GREEN} Successfully replaced cursor texture!')
os.system('pause')
sys.exit()
else:
os.chdir(os.path.expandvars(r'..'))
print(f'{Fore.RED} No roblox files found in {folder}')
if args.remove:
print(f'{Fore.BLUE} Removing empty version folder {folder}')
os.system('rmdir /s/q ' + folder)
time.sleep(0.5)