Compare commits

...

2 Commits

Author SHA1 Message Date
Casey 0ce64231c7
THE GREAT BOTTENING 2024-07-11 05:44:21 +03:00
Casey 1c6d6d8b28
retaw fo ssalg a ma I 2024-07-11 05:21:04 +03:00
4 changed files with 14 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -352,7 +352,7 @@ class Manager:
async def animator(self):
while True:
for animation in self.animations:
frame = int(time.time() / animation.spf) % len(
frame = int(time.time() / animation.spf + animation.offset) % len(
animation.frames
)
self.put_image(

View File

@ -50,8 +50,15 @@
"path": "../pictures/non-reflection.gif",
"x": 300,
"y": 40,
"spf": 15,
"offset": -822
"spf": 5,
"offset": -467
},
{
"type": "animation",
"path": "../pictures/neko.gif",
"spf": 30,
"x": 625,
"y": 496
}
]
}

View File

@ -58,7 +58,7 @@ class WorkerManager:
self.shmem.buf[OFFSET_STATE + byte] & mask
):
await self.queue.put(index)
await asyncio.sleep(0.001)
await asyncio.sleep(0.01)
async def writer(self, bot_index: int, proxy: Optional[str] = None):
connector = ProxyConnector.from_url(proxy) if proxy else None
@ -73,6 +73,8 @@ class WorkerManager:
cookie = bot_index, self._restarts[bot_index]
self.workers.add(cookie)
await sio.send("unsubscribe")
try:
batch = 0
while sio.connected:
@ -80,14 +82,6 @@ class WorkerManager:
byte, bit = index >> 3, index & 7
mask = 0x80 >> bit
if self.shmem.buf[OFFSET_AVOID + byte] & mask:
self.miss_avoid += 1
continue
if (self.shmem.buf[OFFSET_MASK + byte] & mask) == 0:
self.miss_mask += 1
continue
if (self.shmem.buf[OFFSET_CANVAS + byte] & mask) != (
self.shmem.buf[OFFSET_STATE + byte] & mask
):
@ -117,7 +111,7 @@ class WorkerManager:
print()
print(f"Workers: {len(self.workers)} {self.workers}")
print(f"Queue size: {self.queue.qsize()}/{self.queue.maxsize}")
print(f"Toggles: {self.n_toggles / diff:.2f}/s EST: {len(self.workers) / self.delay}")
print(f"Toggles: {self.n_toggles / diff:.2f}/s EST: {self.batch_size * len(self.workers) / self.delay}")
print(f"Misses: A:{self.miss_avoid} M:{self.miss_mask} S:{self.miss_state}")
print(f"Q: {self.queue}")