Compare commits
2 Commits
96f7800fd5
...
0ce64231c7
Author | SHA1 | Date |
---|---|---|
Casey | 0ce64231c7 | |
Casey | 1c6d6d8b28 |
Binary file not shown.
Before Width: | Height: | Size: 317 KiB After Width: | Height: | Size: 1.0 MiB |
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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}")
|
||||
|
|
Loading…
Reference in New Issue