-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodloop.py
More file actions
29 lines (25 loc) · 883 Bytes
/
modloop.py
File metadata and controls
29 lines (25 loc) · 883 Bytes
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
import asyncio
from pavlov import PavlovRCON
import config
async def remove_mods():
pavlov = PavlovRCON(config.IP_ADDRESS, config.PORT, config.PASSWORD)
try:
while True:
try:
response = await pavlov.send("UGCClearModList")
print(response)
# Check if the command was successful
if response.get("Successful"):
print("Command executed successfully.")
else:
print("Command failed.")
await asyncio.sleep(config.DELAY)
except Exception as e:
print(f"An error occurred: {e}")
await asyncio.sleep(config.DELAY)
except KeyboardInterrupt:
print("Exiting script.")
finally:
await pavlov.send("Disconnect")
pavlov.close()
asyncio.run(remove_mods())