forked from blackgear/ingrex_lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
field.py
27 lines (24 loc) · 935 Bytes
/
field.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
from ingrex import Intel, Utils
def main():
"main function"
field = {
'minLngE6': 166071535,
'maxLngE6': 166793004,
'minLatE6': 39741368,
'maxLatE6': 40175495,
}
with open('cookies') as cookies:
cookies = cookies.read().strip()
minxtile, maxytile = Utils.calc_tile(field['minLngE6']/1E6, field['minLatE6']/1E6, 15)
maxxtile, minytile = Utils.calc_tile(field['maxLngE6']/1E6, field['maxLatE6']/1E6, 15)
for xtile in range(minxtile, maxxtile + 1):
for ytile in range(minytile, maxytile + 1):
tilekey = '15_{}_{}_8_8_25'.format(xtile, ytile)
intel = Intel(cookies, field)
result = intel.fetch_map([tilekey])
entities = result['map'][tilekey]['gameEntities']
for entity in entities:
if entity[0].endswith('.9'):
print(entity)
if __name__ == '__main__':
main()