diff --git a/async-bot.py b/async-bot.py index c9dbe2b..21e8e49 100644 --- a/async-bot.py +++ b/async-bot.py @@ -102,7 +102,12 @@ class AsyncBotManager: else: print("unknown event", event, data) - async def writer(self, bot_index: int, proxy_url: Optional[str] = None): + async def writer( + self, + bot_index: int, + proxy_url: Optional[str] = None, + delay: float = 0.25, + ): proxy = ProxyConnector.from_url(proxy_url) if proxy_url else None async with ClientSession(connector=proxy) as http: async with AsyncSimpleClient(http_session=http) as sio: @@ -116,7 +121,7 @@ class AsyncBotManager: if current != expected: print(f"[{bot_index:2d}] swap {x:3d} {y:3d}") await sio.emit("toggle_bit", {"index": index}) - await asyncio.sleep(0.25) + await asyncio.sleep(delay) break await asyncio.sleep(0.1) @@ -204,7 +209,11 @@ async def amain(): if n_proxies := len(settings["proxies"]): await asyncio.gather( *[ - mgr.writer(i, settings["proxies"][i % n_proxies]) + mgr.writer( + i, + settings["proxies"][i % n_proxies], + settings["delay"], + ) for i in range(settings["n_bots"]) ], return_exceptions=True, diff --git a/pictures/casey.png b/pictures/casey.png index efbae85..f226bae 100644 Binary files a/pictures/casey.png and b/pictures/casey.png differ diff --git a/settings.json b/settings.json index 26ee262..e0b8343 100644 --- a/settings.json +++ b/settings.json @@ -2,7 +2,8 @@ "url": "https://onemillioncheckboxes.com", "font": "./ic8x8u.ttf", "proxies": [], - "n_bots": 3, + "n_bots": 5, + "delay": 0.125, "avoid": [ { "type": "rect", @@ -70,8 +71,14 @@ { "type": "image", "path": "./pictures/neko.png", - "x": 32, - "y": 64 + "x": 263, + "y": 229 + }, + { + "type": "image", + "path": "./pictures/casey.png", + "x": 256, + "y": 256 } ] }