-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (25 loc) · 837 Bytes
/
main.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
import asyncio
from tellrcon import TellRCon
from logger import Logger
from utils import mc_formating
def main():
IP = str(input("Enter IP address of RCON >> "))
PORT = int(input("Enter port of RCON >> "))
PASSWORD = str(input("Enter password of RCON >> "))
COMMAND = str(input("Enter command >> "))
LOG = Logger()
rcon = TellRCon(IP, PORT, PASSWORD)
rcon.set_command(COMMAND)
err: bool = False
try:
LOG.info(asyncio.run(rcon.ask_rcon()))
except:
LOG.fatal("Connection error")
err = True
if err is False:
while True:
COMMAND = str(input("Enter command >> "))
rcon.set_command(COMMAND)
LOG.info(mc_formating(asyncio.run(rcon.ask_rcon())))
if __name__ == '__main__':
main()