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 Aug 30, 2023
1 parent 196779a commit 8b2cb7b
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions python/launcher/launcher_esp.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
#LIMPIEZA DE PANTALLA
#IMPORTACIÓN DE MÓDULOS
import os
import sys
import ctypes
import subprocess

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

#CAMBIO DE NOMBRE DE VENTANA
import sys
if sys.platform.startswith('win32'): #WINDOWS
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("Lanzador de Servidores para Minecraft")
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")

def starting():
limpiar_consola()
print("Lanzador de Servidores para Minecraft")
print("-------------------------------------")
print("")
print("Iniciando el Server con " + gbs + "GB de RAM")
comando_java = "java -Xmx" + gbs + " -Xms" + gbs + " -jar server.jar nogui"
resultado = subprocess.run(comando_java, shell=True, capture_output=True, text=True)
print(resultado.stdout)
input()

#BLOQUE DE SELECCIÓN DE RAM
def ram():
limpiar_consola()
Expand All @@ -24,14 +38,10 @@ def ram():
while True:
try:
gbs = int(input("Ingresa los GB de RAM para asignar al Servidor= "))
break
starting()
except ValueError:
ram()

print(f"El valor de gbs es: {gbs}")
print("Presiona Enter para continuar...")


def about():
limpiar_consola()
#CÓDIGO AQUÍ
Expand Down

0 comments on commit 8b2cb7b

Please sign in to comment.