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 CHANGED
@@ -3,4 +3,4 @@ from .ggs_stuff import ggs_login, keeping
3
3
  from .just_funcs import fakescanning, check_updates
4
4
  from .getconfig import getconfig
5
5
  __all__ = [ "ggs_ws", "ggs_login", "fakescanning", "getconfig", "keeping", "check_updates" ]
6
- __version__ = "0.1.6"
6
+ __version__ = "0.1.7"
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 = input("Attacking in a circle (radius) or a square (square)?\n(c/s) -> <-\b\b\b")
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
- pattern = rf"\[{kid},(\d+),(\d+),(\d+),1"
53
- match = re.search(pattern, response)
54
- cid = match.group(1)
55
- global sx, sy
56
- sx = match.group(2)
57
- sy = match.group(3)
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
- sx = int(sx)
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 (only on green map)
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%{{"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}}%""")
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brunogge
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Bilbioteka Python dla Goodgame Empire.
5
5
  Author-email: WojtS & ThunderStorm <wojts8@proton.me>
6
6
  Project-URL: Homepage, https://github.com/wojtsik/brunogge
@@ -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,,
@@ -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,,