From 7a34a77e251e389927ff81a582c2e116f66520e5 Mon Sep 17 00:00:00 2001 From: SirDank <52797753+SirDank@users.noreply.github.com> Date: Thu, 2 Nov 2023 20:52:11 +0530 Subject: [PATCH] beautify Former-commit-id: c8e0bfdb84991e7fd8de64eea686d0500ec04213 --- __modules__/dank.chatroom.py | 2 +- __modules__/dank.game.py | 4 +- __modules__/dank.minecraft-server-builder.py | 72 ++++++++++---------- __modules__/dank.minecraft-server-scanner.py | 18 ++--- __modules__/dank.spotify.py | 18 ++--- __modules__/dank.win-activate.py | 2 +- 6 files changed, 58 insertions(+), 58 deletions(-) diff --git a/__modules__/dank.chatroom.py b/__modules__/dank.chatroom.py index 73c8eb0..7352ede 100644 --- a/__modules__/dank.chatroom.py +++ b/__modules__/dank.chatroom.py @@ -29,7 +29,7 @@ def chatroom_login(): if "missing" in response.content.decode() and response.status_code == 400: - cls(); print(clr(align("\n<---|[ A c c o u n t - C r e a t i o n ]|--->") + "\n\n > Username must be greater than two characters and less than 16 characters, spaces are not counted!")) + cls(); print(clr(align("\n<---|[ A c c o u n t - C r e a t i o n ]|--->") + "\n\n - Username must be greater than two characters and less than 16 characters, spaces are not counted!")) err_msg = "" while True: diff --git a/__modules__/dank.game.py b/__modules__/dank.game.py index 94423ad..4ec2df1 100644 --- a/__modules__/dank.game.py +++ b/__modules__/dank.game.py @@ -81,7 +81,7 @@ def enable_lighting(): # terrain vertices generation start_time = time.time() -print(clr("\n > Generating terrain vertices...")) +print(clr("\n - Generating terrain vertices...")) def generate_vertices(x, z): @@ -146,7 +146,7 @@ def generate_vertices(x, z): triangles = [(0,1,2,3)] uvs = [(0,0),(1,0),(1,1),(0,1)] -print(clr(f"\n > Generated {len(terrain_keys)} sets of terrain vertices in {int(time.time() - start_time)} seconds!\n")) +print(clr(f"\n - Generated {len(terrain_keys)} sets of terrain vertices in {int(time.time() - start_time)} seconds!\n")) del start_time # randomised entity generation diff --git a/__modules__/dank.minecraft-server-builder.py b/__modules__/dank.minecraft-server-builder.py index ff66355..26c03b7 100644 --- a/__modules__/dank.minecraft-server-builder.py +++ b/__modules__/dank.minecraft-server-builder.py @@ -62,7 +62,7 @@ def main_one(): subprocess.run(['java', '-version'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) except: print_read_me() - if input(clr(f"\n > {translate('Java is not installed')}!\n\n > {translate(f'Install Adoptium JRE {latest_java_version}?')} [ y / n ]: ") + red).lower() == 'y': + if input(clr(f"\n - {translate('Java is not installed')}!\n\n > {translate(f'Install Adoptium JRE {latest_java_version}?')} [ y / n ]: ") + red).lower() == 'y': print() os.system(f"winget install EclipseAdoptium.Temurin.{latest_java_version}.JRE") @@ -73,7 +73,7 @@ def main_one(): while True: try: version_list = requests.get("https://api.purpurmc.org/v2/purpur", headers=headers).json()['versions'] - print(clr(f' > {translate("Available Purpur Versions")}: {", ".join(version_list)}')); break + print(clr(f' - {translate("Available Purpur Versions")}: {", ".join(version_list)}')); break except: input(clr(f"\n > {translate('Failed to get purpur versions! Make sure you are connected to the internet! Press [ ENTER ] to try again')}... ",2)) # user inputs [ name, version, ram, allow_cracked ] @@ -139,7 +139,7 @@ def main_one(): # setting max ram string = translate('When setting the Xms and Xmx values, if your host says you have 8000M memory, DO NOT USE 8000M! Minecraft (and Java) needs additional memory on top of that Xmx parameter. It is recommended to reduce your Xmx/Xms by about 1000-1500M to avoid running out of memory or "OOMKiller" hitting your server. This also leaves room for the Operating System to use memory too. Have 8000M memory? Use 6500M for safety. But you may also ask your host if they will cover this overhead for you and give you 9500M instead. Some hosts will! Just ask. We recommend using at least 6-10GB, no matter how few players! If you cannot afford 10GB of memory, give as much as you can. However going out and getting 32GB of RAM for a server will only waste your money with minimal returns.') - print_read_me(); print(clr(f"\n > {string}")) + print_read_me(); print(clr(f"\n - {string}")) print("") while True: ram = input(clr(" > RAM in MB [ Leave 1500MB Free ]: ") + red) @@ -149,7 +149,7 @@ def main_one(): # use playit.gg - print_read_me(); print(clr(f"\n > {translate('Great! Now you need to pick a host for your mc server!')}\n\n > {translate('If you are new to hosting and would like to quickly host a server with the playit.gg plugin without port-forwarding')}\n - {translate('Choose Option 1')}\n\n > {translate('If you are experienced and would like to skip playit.gg and use port-forwarding or alternative hosting methods')}\n - {translate('Choose Option 2')}")) + print_read_me(); print(clr(f"\n - {translate('Great! Now you need to pick a host for your mc server!')}\n\n - {translate('If you are new to hosting and would like to quickly host a server with the playit.gg plugin without port-forwarding')}\n - {translate('Choose Option 1')}\n\n - {translate('If you are experienced and would like to skip playit.gg and use port-forwarding or alternative hosting methods')}\n - {translate('Choose Option 2')}")) print("") while True: @@ -182,7 +182,7 @@ def main_one(): # begin preparing downloads - cls(); print(clr(f"\n > {translate('Preparing Downloads')}...")) + cls(); print(clr(f"\n - {translate('Preparing Downloads')}...")) to_download_urls, to_download_file_names = [], [] # github server-builder files and plugins @@ -260,15 +260,15 @@ def main_one(): to_download_urls.append(file_url) to_download_file_names.append(f"plugins/{file_url.split('/')[-1]}") - # > AutoPlug + # - AutoPlug to_download_urls.append("https://github.com/Osiris-Team/AutoPlug-Releases/raw/master/stable-builds/AutoPlug-Client.jar") to_download_file_names.append("AutoPlug-Client.jar") - # > purpur.jar + # - purpur.jar to_download_urls.append(f"https://api.purpurmc.org/v2/purpur/{version}/latest/download") to_download_file_names.append("purpur.jar") - # > MCAntiMalware.jar + # - MCAntiMalware.jar for file_url in github_file_selector("OpticFusion1/MCAntiMalware", "add", ['MCAntiMalware']): to_download_urls.append(file_url) to_download_file_names.append(file_url.split('/')[-1]) @@ -282,18 +282,18 @@ def file_downloader(url, file_name): try: size = '{:.3}'.format(int(response.headers['Content-Length'])/1024000) except: size = "?" open(file_name,"wb").write(data) - print(clr(f" > {translate('Downloaded')} [ {file_name} ] [ {size} MB ]\n")); break + print(clr(f" - {translate('Downloaded')} [ {file_name} ] [ {size} MB ]\n")); break except: input(clr(f" > {translate('Failed')} [ {file_name} ] Press {white}ENTER{red} to try again... \n",2)) rm_line(); rm_line() # disabled due to repeated error reports - '''print_read_me(); input(clr("\n > Do not use [ Ctrl + C ]!\n\n > Press [ ENTER ] to start the multithreaded download process... ")) + '''print_read_me(); input(clr("\n - Do not use [ Ctrl + C ]!\n\n > Press [ ENTER ] to start the multithreaded download process... ")) # begin multithreaded downloader | threads = 2 - print(clr("\n > Starting Multiple Downloads... [ this might take a few minutes ]")) + print(clr("\n - Starting Multiple Downloads... [ this might take a few minutes ]")) while True: try: @@ -305,7 +305,7 @@ def file_downloader(url, file_name): # begin single threaded downloader - print(clr(f"\n > {translate('Downloading... [ this might take a few minutes ]')}\n")) + print(clr(f"\n - {translate('Downloading... [ this might take a few minutes ]')}\n")) start_time = time.time() #for url, file_name in zip(to_download_urls, to_download_file_names): @@ -314,11 +314,11 @@ def file_downloader(url, file_name): time_taken = int(time.time()-start_time) - print(clr(f"\n > {translate(f'Finished downloads in {time_taken} seconds! Sleeping for 3 seconds')}...")); time.sleep(3) + print(clr(f"\n - {translate(f'Finished downloads in {time_taken} seconds! Sleeping for 3 seconds')}...")); time.sleep(3) # unpacking downloaded archives - '''print(clr(f"\n > {translate('Unpacking')}...")) + '''print(clr(f"\n - {translate('Unpacking')}...")) for file in ['theend', 'overworld', 'deepwoods']: # 'newhorizons' @@ -339,7 +339,7 @@ def file_downloader(url, file_name): # creating local files -cls(); print(clr(f"\n > {translate('Creating local files')}...")) +cls(); print(clr(f"\n - {translate('Creating local files')}...")) open('eula.txt','w').write('eula=true') @@ -705,18 +705,18 @@ def file_downloader(url, file_name): def main_two(): string = f''' - > {translate('Start the server once ( it will stop automatically on the first run ) to generate config files to be optimized')} + - {translate('Start the server once ( it will stop automatically on the first run ) to generate config files to be optimized')} - > quick_chmod.sh - {translate('Script to make all .sh files executable')} - > quick_install_java.sh / quick_install_java.cmd - {translate('Script to install Temurin JRE')} - > mc-anti-malware.sh / mc-anti-malware.cmd - {translate('Script to start mc-anti-malware')} - > start_server.sh / start_server.cmd - {translate('Script to start your server')} - > ".check java" - {translate('Command to install Java VM')} - > ".start" - {translate('Command to start the server')} - > ".stop" - {translate('Command to stop the server')} - > ".stop both" - {translate('Command to stop the server and Autoplug')} - > ".check plugins" - {translate('Command to update configured plugins')} - > ".help" - {translate('Command to display all available commands')} + - quick_chmod.sh : {translate('Script to make all .sh files executable')} + - quick_install_java.sh / quick_install_java.cmd : {translate('Script to install Temurin JRE')} + - mc-anti-malware.sh / mc-anti-malware.cmd : {translate('Script to start mc-anti-malware')} + - start_server.sh / start_server.cmd : {translate('Script to start your server')} + - ".check java" : {translate('Command to install Java VM')} + - ".start" : {translate('Command to start the server')} + - ".stop" : {translate('Command to stop the server')} + - ".stop both" : {translate('Command to stop the server and Autoplug')} + - ".check plugins" : {translate('Command to update configured plugins')} + - ".help" : {translate('Command to display all available commands')} > {translate('After your server has run at least once, press [ ENTER ] to apply custom configuration')}... ''' @@ -749,33 +749,33 @@ def config_updater(path): if playit: string = f''' - > {translate('It is extremely easy to setup the playit.gg plugin')} + - {translate('It is extremely easy to setup the playit.gg plugin')} - > {translate('After server setup is complete, start your server.')} + - {translate('After server setup is complete, start your server.')} - > {translate('Click on the URL displayed on the console.')} + - {translate('Click on the URL displayed on the console.')} - > {translate("Create an account and login if you haven't already to save the tunnel on playit.gg")} + - {translate("Create an account and login if you haven't already to save the tunnel on playit.gg")} - > {translate('Click "Add Agent"')} + - {translate('Click "Add Agent"')} - > {translate("A tunnel will be created and your server's public ip will be displayed: example.craft.playit.gg")} + - {translate("A tunnel will be created and your server's public ip will be displayed: example.craft.playit.gg")} > {translate('Press [ ENTER ] after you have read the message')}... ''' print_read_me(); input(clr(string)) else: - print_read_me(); print(clr(f"\n > {translate('As you have not selected playit.gg as a host, To allow players to connect to your server over the internet, you could follow this tutorial on port-forwarding.')}")) + print_read_me(); print(clr(f"\n - {translate('As you have not selected playit.gg as a host, To allow players to connect to your server over the internet, you could follow this tutorial on port-forwarding.')}")) if input(clr(f"\n > {translate('Open port forwarding tutorial on youtube?')} [ y / n ]: ") + red).lower() == "y": sys_open('https://youtu.be/X75GbRaGzu8') tmp_path = f'{dir_name}\\autoplug\\updater.yml' string = f''' - > {translate(f'If you would like to transfer the server to a linux system and run it there, set "build-id: 0" inside "{tmp_path}"')} + - {translate(f'If you would like to transfer the server to a linux system and run it there, set "build-id: 0" inside "{tmp_path}"')} - > {translate(f'After you move the folder to a linux system, run "sudo chmod +x {tmp_path}/quick_chmod.sh" to make all .sh files executable')} + - {translate(f'After you move the folder to a linux system, run "sudo chmod +x {tmp_path}/quick_chmod.sh" to make all .sh files executable')} - > {translate('Run "start_server.sh" and then install JVM with the ".check java" command')} + - {translate('Run "start_server.sh" and then install JVM with the ".check java" command')} > {translate('Press [ ENTER ] after you have read the message')}... ''' diff --git a/__modules__/dank.minecraft-server-scanner.py b/__modules__/dank.minecraft-server-scanner.py index d1707fd..5a89449 100644 --- a/__modules__/dank.minecraft-server-scanner.py +++ b/__modules__/dank.minecraft-server-scanner.py @@ -71,7 +71,7 @@ def save_server(ip): for _ in ('§0', '§1', '§2', '§3', '§4', '§5', '§6', '§7', '§8', '§9', '§a', '§b', '§c', '§d', '§e', '§f', '§l', '§n', '§o', '§m', '§k', '§r'): to_print = to_print.replace(_,'') - print(clr(f" > {to_print}\n")) + print(clr(f" - {to_print}\n")) open('servers.txt','a',encoding='utf-8').write(f"\n{to_print}") except: @@ -106,8 +106,8 @@ def main(): # get user input cls(); print(align(clr(banner,4,colours=[white, white_normal, red, red_normal, red_dim]))) - print(clr(f"\n > Java Server List: https://dank-site.onrender.com/minecraft-java-servers\n\n > Bedrock Server List: https://dank-site.onrender.com/minecraft-bedrock-servers\n\n > {translate('You can use the above links to get a list of servers that have been found by the users of this tool')}!")) - choice = input(clr("\n > 1: Open Java Server List | 2: Open Bedrock Server List | ENTER: Skip\n\n > Choice [1/2/ENTER]: ") + red) + print(clr(f"\n - Java Server List: https://dank-site.onrender.com/minecraft-java-servers\n\n - Bedrock Server List: https://dank-site.onrender.com/minecraft-bedrock-servers\n\n - {translate('You can use the above links to get a list of servers that have been found by the users of this tool')}!")) + choice = input(clr("\n - 1: Open Java Server List | 2: Open Bedrock Server List | ENTER: Skip\n\n > Choice [1/2/ENTER]: ") + red) if choice == "1": os.system("start https://dank-site.onrender.com/minecraft-java-servers") elif choice == "2": os.system("start https://dank-site.onrender.com/minecraft-bedrock-servers") @@ -133,7 +133,7 @@ def main(): # get user input cls(); print(align(clr(banner,4,colours=[white, white_normal, red, red_normal, red_dim]))) - print(clr(f"\n > {translate('Start with 100 threads and note the performance impact')}.\n\n > {translate('Generally should be smooth upto 500 threads, you might notice some performance impact above this value')}!\n\n > {translate('Start with 50000 IPs, it will take a few seconds to generate')}.")) + print(clr(f"\n - {translate('Start with 100 threads and note the performance impact')}.\n\n - {translate('Generally should be smooth upto 500 threads, you might notice some performance impact above this value')}!\n\n - {translate('Start with 50000 IPs, it will take a few seconds to generate')}.")) print("") while True: @@ -160,7 +160,7 @@ def main(): # disclaimer - cls(); input(clr(f"\n [IMPORTANT]\n\n > {translate('Do not use [ Ctrl + C ] without selecting text first')}!\n\n > {translate('All the servers are saved to servers.txt')}!\n\n > {translate('Press [ ENTER ] to start the multithreaded scanner')}... ")) + cls(); input(clr(f"\n [IMPORTANT]\n\n - {translate('Do not use [ Ctrl + C ] without selecting text first')}!\n\n - {translate('All the servers are saved to servers.txt')}!\n\n > {translate('Press [ ENTER ] to start the multithreaded scanner')}... ")) cls() # generate and check ips on multiple threads in batches @@ -178,7 +178,7 @@ def main(): # multithreaded generator #cls() - print(clr(f"\n > Generating {gen_amt} unique ips...")) + print(clr(f"\n - Generating {gen_amt} unique ips...")) while generated < gen_amt: while True: try: @@ -194,7 +194,7 @@ def main(): while True: try: #cls() - print(clr(f"\n > Checking {len(ips)} unique ips...\n")) + print(clr(f"\n - Checking {len(ips)} unique ips...\n")) if server_type == "java": multithread(check_java, threads, tuple(ips.keys())); break else: multithread(check_bedrock, threads, tuple(ips.keys())); break except: input(clr(f"\n > {translate('Failed to check ips! Do not use [ Ctrl + C ]! Press [ENTER] to try again')}... ",2)); rm_line() @@ -204,13 +204,13 @@ def main(): scan_count = int(open('scan_count.txt','r',encoding='utf-8').read()) scan_count += len(ips) open('scan_count.txt','w',encoding='utf-8').write(str(scan_count)) - print(clr(f"\n > Totally Scanned {scan_count} IPs!")) + print(clr(f"\n - Totally Scanned {scan_count} IPs!")) time.sleep(5) gen_rem -= gen_amt if gen_rem > 0: - print(clr(f"\n > {gen_rem} IPs remaining...")) + print(clr(f"\n - {gen_rem} IPs remaining...")) if __name__ == "__main__": diff --git a/__modules__/dank.spotify.py b/__modules__/dank.spotify.py index d8ef6fa..c7f1d85 100644 --- a/__modules__/dank.spotify.py +++ b/__modules__/dank.spotify.py @@ -31,27 +31,27 @@ def main(): banner2 = '\n\nMP""""""`MM oo dP oo .8888b \nM mmmmm..M 88 88 " \nM. `YM 88d888b. dP .d8888b. .d8888b. d8888P dP 88aaa dP dP \nMMMMMMM. M 88\' `88 88 88\' `"" 88ooood8 88 88 88 88 88 \nM. .MMM\' M 88. .88 88 88. ... 88. ... 88 88 88 88. .88 \nMb. .dM 88Y888P\' dP `88888P\' `88888P\' dP dP dP `8888P88 \nMMMMMMMMMMM 88 .88 \n dP d8888P \n' cls(); print(align(clr(banner1,4,colours=[white, white_normal, green, green_normal, green_dim]) + align(clr('+')) + align(clr(banner2,4,colours=[white, white_normal, yellow, yellow_normal, yellow_dim])))) - print(clr(f"\n > {translate('NOTE: If you have never installed Spotify before, this will install it for you but you will need to sign in manually. In only this case you will need to re-run this module to complete the spicetify installation')}.")) + print(clr(f"\n - {translate('NOTE: If you have never installed Spotify before, this will install it for you but you will need to sign in manually. In only this case you will need to re-run this module to complete the spicetify installation')}.")) input(clr(f"\n > {translate('Hit [ ENTER ] to begin installation')}... ")) while True: cls() try: - print(clr(f"\n > {translate('terminating Spotify')}...\n")) + print(clr(f"\n - {translate('terminating Spotify')}...\n")) os.system('taskkill /f /im spotify.exe >nul 2>&1') - print(clr(f"\n > {translate('restoring Spotify')}...\n")) + print(clr(f"\n - {translate('restoring Spotify')}...\n")) os.system('spicetify restore') - print(clr("\n > installing SpotX...\n\n [ RECOMMENDED SETTINGS ]\n - Install Over\n - Disable Podcasts\n - Enable Auto-Clear Cache (30d)\n - Block Updates")) + print(clr("\n - installing SpotX...\n\n [ RECOMMENDED SETTINGS ]\n - Install Over\n - Disable Podcasts\n - Enable Auto-Clear Cache (30d)\n - Block Updates")) os.system('powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString(\'https://raw.githubusercontent.com/SpotX-Official/SpotX/main/run.ps1\'))} -confirm_uninstall_ms_spoti -confirm_spoti_recomended_over -podcasts_off -cache_on -block_update_on -start_spoti -new_theme -adsections_off -lyrics_stat spotify"') input(clr(f" > {translate('Hit [ ENTER ] if you are signed in to Spotify')}... ")) - print(clr(f"\n > {translate('terminating Spotify')}...\n")) + print(clr(f"\n - {translate('terminating Spotify')}...\n")) os.system('taskkill /f /im spotify.exe >nul 2>&1') - print(clr(f"\n > {translate('installing Spicetify-CLI... (N to start installation)')}\n")) + print(clr(f"\n - {translate('installing Spicetify-CLI... (N to start installation)')}\n")) os.system('powershell -Command "& Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/spicetify/spicetify-cli/master/install.ps1 | iex"') - print(clr(f"\n > {translate('installing Spicetify-Marketplace')}...\n")) + print(clr(f"\n - {translate('installing Spicetify-Marketplace')}...\n")) os.system('powershell -Command "& iwr -useb https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/install.ps1 | iex"') - print(clr(f"\n > {translate('applying Spicetify')}...\n")) + print(clr(f"\n - {translate('applying Spicetify')}...\n")) os.system('spicetify restore backup apply') - print(clr(f"\n > {translate('Sleeping for 5 seconds')}...\n")) + print(clr(f"\n - {translate('Sleeping for 5 seconds')}...\n")) time.sleep(5) #os.system('start cmd.exe @cmd /k "spicetify backup apply && timeout 5 && exit"') break diff --git a/__modules__/dank.win-activate.py b/__modules__/dank.win-activate.py index d177787..fbb78c5 100644 --- a/__modules__/dank.win-activate.py +++ b/__modules__/dank.win-activate.py @@ -34,7 +34,7 @@ def main(): while True: cls() try: - print(clr(f"\n > {translate('Exit inside the MAS window to return to the menu')}...")) + print(clr(f"\n - {translate('Exit inside the MAS window to return to the menu')}...")) os.system('powershell -Command "irm https://massgrave.dev/get | iex"') break except: input(clr(f"\n > {translate('Failed to launch! Make sure you are connected to the internet! Press [ENTER] to try again')}... ",2))