mirror of
https://github.com/JonasunderscoreJones/Minecraft-server-Status.git
synced 2025-10-22 18:29:17 +02:00
Added configurable delay
Made it so you can define how many seconds you want between server status updates.
This commit is contained in:
parent
a2d109113e
commit
d5bd9818fd
1 changed files with 8 additions and 2 deletions
|
@ -3,6 +3,12 @@ from time import sleep
|
||||||
|
|
||||||
ip = input("Please Enter server IP: ")
|
ip = input("Please Enter server IP: ")
|
||||||
port = input("Enter Port (press enter for default port 25565, enter 0 if unknown): ")
|
port = input("Enter Port (press enter for default port 25565, enter 0 if unknown): ")
|
||||||
|
delay = input("How many seconds do you want in between status updates?: ")
|
||||||
|
|
||||||
|
if delay == "":
|
||||||
|
delay_int = 0
|
||||||
|
|
||||||
|
delay_int = int(delay)
|
||||||
|
|
||||||
if port == "":
|
if port == "":
|
||||||
port = "25565"
|
port = "25565"
|
||||||
|
@ -26,7 +32,7 @@ if port == "0":
|
||||||
print(f"players: {status.players.online}/{status.players.max}")
|
print(f"players: {status.players.online}/{status.players.max}")
|
||||||
print(f"Players Online: {query.players.names}")
|
print(f"Players Online: {query.players.names}")
|
||||||
print("\n")
|
print("\n")
|
||||||
wait(3)
|
sleep(delay_int)
|
||||||
|
|
||||||
if port != "0":
|
if port != "0":
|
||||||
while True:
|
while True:
|
||||||
|
@ -42,4 +48,4 @@ if port != "0":
|
||||||
print(f"players: {status.players.online}/{status.players.max}")
|
print(f"players: {status.players.online}/{status.players.max}")
|
||||||
print(f"Players Online: {query.players.names}")
|
print(f"Players Online: {query.players.names}")
|
||||||
print("\n")
|
print("\n")
|
||||||
wait(3)
|
sleep(delay_int)
|
Loading…
Add table
Add a link
Reference in a new issue