forked from Farama-Foundation/MicroRTS
-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.txt
43 lines (39 loc) · 960 Bytes
/
test.txt
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
37
38
39
40
41
42
43
# create a worker
t = [{
"unitID": 20,
"unitAction": {
'type': 4,
'parameter': 3,
'unitType': 'Worker'
}
}]
k = json.dumps(t)
conn.send(('%s\n' % k).encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))
# move a worker
t = [{
"unitID": 22,
"unitAction": {
'type': 1,
'parameter': 2
}
}]
k = json.dumps(t)
conn.send(('%s\n' % k).encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))
# skip idle frames
for i in range(9):
conn.send(('%s\n' % "[]").encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))
# desired action input
t = [[1, 1, 1, 2]]
k = json.dumps(t)
conn.send(('%s\n' % k).encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))
# skip idle frames
for i in range(9):
conn.send(('%s\n' % "[]").encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))
# finish the current epoch
conn.send(('%s\n' % "done").encode('utf-8'))
print(conn.recv(4096).decode('utf-8'))