brunogge 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brunogge/__init__.py +1 -1
- brunogge/getconfig.py +2 -9
- brunogge/ggs_stuff.py +15 -9
- brunogge/just_funcs.py +8 -8
- {brunogge-0.1.6.dist-info → brunogge-0.1.7.dist-info}/METADATA +1 -1
- brunogge-0.1.7.dist-info/RECORD +11 -0
- brunogge-0.1.6.dist-info/RECORD +0 -11
- {brunogge-0.1.6.dist-info → brunogge-0.1.7.dist-info}/WHEEL +0 -0
- {brunogge-0.1.6.dist-info → brunogge-0.1.7.dist-info}/top_level.txt +0 -0
brunogge/__init__.py
CHANGED
brunogge/getconfig.py
CHANGED
@@ -29,14 +29,6 @@ def getconfig(type:str ,savename:str ,created: str | None = "y") -> dict:
|
|
29
29
|
front_tool_ammount1 = config.getint(savename, "front_tool_ammount1") # converted to int
|
30
30
|
front_id_2 = config.get(savename, "front_id_2")
|
31
31
|
front_tool_ammount2 = config.getint(savename, "front_tool_ammount2") # converted to int
|
32
|
-
if kid == "g":
|
33
|
-
kid = "0"
|
34
|
-
elif kid == "s":
|
35
|
-
kid = "1"
|
36
|
-
elif kid == "c":
|
37
|
-
kid = "2"
|
38
|
-
elif kid == "f":
|
39
|
-
kid = "3"
|
40
32
|
# Return as a dictionary
|
41
33
|
result = {
|
42
34
|
"nick": nick,
|
@@ -152,7 +144,7 @@ def config_maker_barons(savename, filename = "baronconfig.ini"):
|
|
152
144
|
excluded_commanders = input_int_list("Enter excluded commanders (comma separated integers, e.g. 2,3,17. -1 if none): ")
|
153
145
|
config.set(save_name, "excluded_commanders", excluded_commanders)
|
154
146
|
|
155
|
-
radius_option =
|
147
|
+
radius_option = "c"
|
156
148
|
config.set(save_name, "radius_option", radius_option)
|
157
149
|
|
158
150
|
distance = input_int("Distance for attacks (not preicse): ")
|
@@ -222,3 +214,4 @@ def config_maker_barons(savename, filename = "baronconfig.ini"):
|
|
222
214
|
config.write(f)
|
223
215
|
|
224
216
|
print(f"\nConfiguration saved.")
|
217
|
+
exit()
|
brunogge/ggs_stuff.py
CHANGED
@@ -49,13 +49,21 @@ async def ggs_login(ws, nick: str, pwrd: str, server: str, kid: int | None = 0)
|
|
49
49
|
response = await asyncio.wait_for(ws.recv(), timeout=4)
|
50
50
|
response = response.decode('utf-8')
|
51
51
|
if "%xt%jaa%1%0%" in response:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
sx_list = []
|
53
|
+
sy_list = []
|
54
|
+
cid_list = []
|
55
|
+
for i in range(4):
|
56
|
+
pattern = rf"\[{i},(\d+),(\d+),(\d+),1"
|
57
|
+
match = re.search(pattern, response)
|
58
|
+
cid = match.group(1)
|
59
|
+
sx = match.group(2)
|
60
|
+
sy = match.group(3)
|
61
|
+
sx_list.append(sx)
|
62
|
+
sy_list.append(sy)
|
63
|
+
cid_list.append(cid)
|
64
|
+
print(f"Coord {i} X: {sx}, Coord Y: {sy}")
|
58
65
|
break
|
66
|
+
|
59
67
|
except asyncio.TimeoutError:
|
60
68
|
break
|
61
69
|
|
@@ -71,9 +79,7 @@ async def ggs_login(ws, nick: str, pwrd: str, server: str, kid: int | None = 0)
|
|
71
79
|
break
|
72
80
|
else:
|
73
81
|
print("Connection closed, stopping login")
|
74
|
-
|
75
|
-
sy = int(sy)
|
76
|
-
return sx, sy, lids, cid
|
82
|
+
return sx_list, sy_list, lids, cid_list
|
77
83
|
|
78
84
|
async def keeping(ws, server: str) -> None:
|
79
85
|
"""Keep the connection alive by sending periodic messages."""
|
brunogge/just_funcs.py
CHANGED
@@ -44,9 +44,9 @@ def getserver(server: str, option: str | None = "full") -> str:
|
|
44
44
|
elif option == "ws":
|
45
45
|
return wsuri
|
46
46
|
|
47
|
-
async def fakescanning(ws, server: str) -> None:
|
47
|
+
async def fakescanning(ws, server: str, kid: str | None = "0") -> None:
|
48
48
|
"""
|
49
|
-
Fake scanning the map while doing other things
|
49
|
+
Fake scanning the map while doing other things
|
50
50
|
|
51
51
|
"""
|
52
52
|
empireex = getserver(server, "ex")
|
@@ -54,12 +54,12 @@ async def fakescanning(ws, server: str) -> None:
|
|
54
54
|
while ws.open:
|
55
55
|
for delay in delays:
|
56
56
|
print("Fake scanned...")
|
57
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
58
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
59
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
60
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
61
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
62
|
-
await ws.send(f"""%xt%{empireex}%gaa%1%{{"
|
57
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":0,"AY1":0,"AX2":12,"AY2":12}}%""")
|
58
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":1274,"AY1":0,"AX2":1286,"AY2":12}}%""")
|
59
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":13,"AY1":0,"AX2":25,"AY2":12}}%""")
|
60
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":1274,"AY1":13,"AX2":1286,"AY2":25}}%""")
|
61
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":0,"AY1":13,"AX2":12,"AY2":25}}%""")
|
62
|
+
await ws.send(f"""%xt%{empireex}%gaa%1%{{"{kid}":0,"AX1":13,"AY1":13,"AX2":25,"AY2":25}}%""")
|
63
63
|
await asyncio.sleep(delay * 60)
|
64
64
|
|
65
65
|
import subprocess
|
@@ -0,0 +1,11 @@
|
|
1
|
+
brunogge/__init__.py,sha256=_u8TClHjNx5Eee66_nmgrFu-VdQw8P9xoZ-EBipFGSo,275
|
2
|
+
brunogge/barony.py,sha256=6Xm-i5AaXa8oVQ_kzX0_tDZucoBVplF7gYTGuad6djk,14891
|
3
|
+
brunogge/get_ws.py,sha256=nPsvNReq4DzflvOItHOd3WgajAV7f3ckeZr8qRADYsI,709
|
4
|
+
brunogge/getconfig.py,sha256=6mSdy_udDDSSZaxe7y_zwI8nT-hkUdOngh8nM7A1kGg,9438
|
5
|
+
brunogge/ggs_stuff.py,sha256=vfjB5shnOHsOgyuUfRrsKs4gOfXsIGvgf_7Gu_Q6yoQ,5080
|
6
|
+
brunogge/just_funcs.py,sha256=H5cuxNYnWrs7hgr4XCM7RZRkcbFUuAiS306vIx_4nWI,3956
|
7
|
+
brunogge/server_list.json,sha256=5hZrlPH7tbFY7m1bqMMgsKiyHkGiPTnVMAW2B9WLabc,5084
|
8
|
+
brunogge-0.1.7.dist-info/METADATA,sha256=k7YezRzDfxQ6iK8XKwL4fNymlfdK_EO3Rp27Q20t8uk,328
|
9
|
+
brunogge-0.1.7.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
10
|
+
brunogge-0.1.7.dist-info/top_level.txt,sha256=oTTOxi0gm7TPhnipjl1nIXsYLRrnWnDzKKLCfRVhAjw,9
|
11
|
+
brunogge-0.1.7.dist-info/RECORD,,
|
brunogge-0.1.6.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
brunogge/__init__.py,sha256=oN1NvcC60bbtO24YFFRSbnRmBIgK1LCsSDfx-lwZ2Q8,275
|
2
|
-
brunogge/barony.py,sha256=6Xm-i5AaXa8oVQ_kzX0_tDZucoBVplF7gYTGuad6djk,14891
|
3
|
-
brunogge/get_ws.py,sha256=nPsvNReq4DzflvOItHOd3WgajAV7f3ckeZr8qRADYsI,709
|
4
|
-
brunogge/getconfig.py,sha256=fnFnuAAUdffK2ywjOsDtFCvKbzWSzoKYFw2lSo-zccI,9761
|
5
|
-
brunogge/ggs_stuff.py,sha256=QCBgVxbzfkr_pz1IFD11SVtGxzbYb-lgYjuJJLZgkwU,4771
|
6
|
-
brunogge/just_funcs.py,sha256=KDKzWU7zJlF1iGae2Lx3GaXABQRa99VRd2eOKkmbh9s,3941
|
7
|
-
brunogge/server_list.json,sha256=5hZrlPH7tbFY7m1bqMMgsKiyHkGiPTnVMAW2B9WLabc,5084
|
8
|
-
brunogge-0.1.6.dist-info/METADATA,sha256=ixxRYxskYkvsjFkS-r6-vbRFhzDer8n90ftfSZbxzyA,328
|
9
|
-
brunogge-0.1.6.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
10
|
-
brunogge-0.1.6.dist-info/top_level.txt,sha256=oTTOxi0gm7TPhnipjl1nIXsYLRrnWnDzKKLCfRVhAjw,9
|
11
|
-
brunogge-0.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|