-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (30 loc) · 967 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
36
# https://github.com/DataDog/datadogpy
# https://github.com/py3minepi/py3minepi
import mcpi.minecraft as minecraft
import render
import fetch
from dashboard import Dashboard
import math
import time
import sys
from cleanup import set_cleanup_callback
from letter import initialize_font
# mc=minecraft.Minecraft.create()
# mc.postToChat("hello world")
if __name__ == '__main__':
fetch.initialize()
initialize_font()
mc = minecraft.Minecraft.create("172.86.162.69")
dashboards = []
# Load dashboards
for arg in sys.argv[1:]:
dashboards.append(Dashboard(arg, mc))
set_cleanup_callback(lambda: [dashboard.cleanup()
for dashboard in dashboards])
# Run the update every n seconds
while True:
print("drawing %d dashboard(s), pos: %s" %
(len(dashboards), mc.player.getTilePos()))
for dashboard in dashboards:
dashboard.update()
time.sleep(5)