Skip to content

Commit

Permalink
Update launcher_esp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ngdplnk committed Sep 2, 2023
1 parent d32188b commit 43e0663
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions python/launcher/launcher_esp.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
#IMPORTACIÓN DE MÓDULOS
#IMPORTACIÓN MÓDULOS
import os
import time
import sys
import ctypes
import subprocess
import webbrowser

#LIMPIEZA DE PANTALLA
#LIMPIEZA PANTALLA
def limpiar_consola():
if os.name == 'nt': #WINDOWS
if os.name == 'nt':#WINDOWS
os.system('cls')
else: #LINUX O MACOS
else:#LINUX O MACOS
os.system('clear')

#CAMBIO DE NOMBRE DE VENTANA
if sys.platform.startswith('win32'): #WINDOWS
#CAMBIO NOMBRE VENTANA
if sys.platform.startswith('win32'):#WINDOWS
ctypes.windll.kernel32.SetConsoleTitleW("Lanzador de Servidores para Minecraft")
elif sys.platform.startswith('linux') or sys.platform.startswith('darwin'): #LINUX O MACOS
elif sys.platform.startswith('linux') or sys.platform.startswith('darwin'):#LINUX O MACOS
sys.stdout.write(f"\x1b]2;Lanzador de Servidores para Minecraft\x07")

#BLOQUE DE SELECCIÓN DE RAM E INICIO
#BLOQUE REGRESO
def menu():
return

#BLOQUE SELECCIÓN RAM INICIO
def ram():
limpiar_consola()
print("Lanzador de Servidores para Minecraft\n-------------------------------------\n\nPuedes volver al Menú Principal con 'N', o")
while True:
entrada = input("Ingresa los GB de RAM para asignar al Servidor= ")
if entrada.lower() == 'n':
break
try:
gbs = int(input("Ingresa los GB de RAM para asignar al Servidor= "))
gbs = int(entrada)
limpiar_consola()
print("Lanzador de Servidores para Minecraft\n-------------------------------------\n")
print("Iniciando el Server con",gbs,"GB de RAM")
Expand All @@ -35,28 +42,29 @@ def ram():
input("\nPresiona una tecla para continuar")
limpiar_consola()
print("Lanzador de Servidores para Minecraft\n-------------------------------------\n\nServidor Cerrado\n\nPuedes revisar el registro en la carpeta 'logs'\n")
input()
input("Presiona una tecla para continuar")
break
except ValueError:
ram()

#BLOQUE LICENCIAS
def about():
limpiar_consola()
url = "https://github.com/NGDPLNk/SSTools4MC/blob/main/LICENSE"
print("Lanzador de Servidores para Minecraft\n-------------------------------------\n\nSe abrira la informacion sobre Licencia mas reciente en el navegador\n")
print(url)
print("")
input("Presiona cualquier tecla para continuar")
input("Presiona una tecla para continuar")
webbrowser.open(url)

#BLOQUE SALIDA
def exiit():
limpiar_consola()
print("--------------------------------------------\nGracias por usar esta Herramienta\nMIT License - Copyright (c) 2023 NGDPL Nk\n--------------------------------------------\n")
time.sleep(3)
sys.exit()

def dbmode():
limpiar_consola()
#CÓDIGO AQUÍ

#BLOQUE MENÚ PRINCIPAL
while True:
limpiar_consola()
print("Lanzador de Servidores para Minecraft\n-------------------------------------\n\nMenú Principal\n\n(1) Iniciar Servidor\n(2) Licencia\n(3) Salir\n")
Expand All @@ -67,5 +75,3 @@ def dbmode():
about()
elif seleccion == "3":
exiit()
elif seleccion == "4":
dbmode()

0 comments on commit 43e0663

Please sign in to comment.