kenenet 1.2.3__py3-none-any.whl → 1.2.5__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.
- kenenet/__init__.py +29 -2
- {kenenet-1.2.3.dist-info → kenenet-1.2.5.dist-info}/METADATA +1 -1
- kenenet-1.2.5.dist-info/RECORD +5 -0
- kenenet-1.2.3.dist-info/RECORD +0 -5
- {kenenet-1.2.3.dist-info → kenenet-1.2.5.dist-info}/WHEEL +0 -0
- {kenenet-1.2.3.dist-info → kenenet-1.2.5.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import sys, zhmiscellany, keyboard, mss, time, linecache, os, random, pyperclip, inspect, re
|
1
|
+
import sys, zhmiscellany, keyboard, mss, time, linecache, os, random, pyperclip, inspect, re, ast
|
2
2
|
import numpy as np
|
3
3
|
from PIL import Image
|
4
4
|
from collections import defaultdict
|
@@ -520,6 +520,8 @@ def time_loop(iterable, cutoff_time=0.1):
|
|
520
520
|
yield item
|
521
521
|
if time.time() > end_time:
|
522
522
|
break
|
523
|
+
|
524
|
+
ct = time_loop
|
523
525
|
|
524
526
|
def get_focused_process_name(mute=False):
|
525
527
|
hwnd = win32gui.GetForegroundWindow()
|
@@ -543,7 +545,32 @@ def coord_rgb(coord=None):
|
|
543
545
|
return rgb
|
544
546
|
else: return None
|
545
547
|
|
546
|
-
|
548
|
+
cr = coord_rgb
|
549
|
+
|
550
|
+
def rgb_at_coord(coord=None, rgb=None, range=1):
|
551
|
+
if not coord or not rgb:
|
552
|
+
return False
|
553
|
+
with mss.mss() as sct:
|
554
|
+
region = {"left": coord[0], "top": coord[1], "width": 1, "height": 1}
|
555
|
+
rgb_ac = sct.grab(region).pixel(0, 0)
|
556
|
+
return all(abs(a - b) <= range for a, b in zip(rgb_ac, rgb))
|
557
|
+
|
558
|
+
rac = rgb_at_coord
|
559
|
+
|
560
|
+
def if_condition(s):
|
561
|
+
e = s.strip()[3:] if s.strip().startswith("if ") else s
|
562
|
+
tree = ast.parse(e, mode="eval").body
|
563
|
+
ctx = {**inspect.currentframe().f_back.f_globals, **inspect.currentframe().f_back.f_locals}
|
564
|
+
full = eval(compile(ast.Expression(tree), "<ast>", "eval"), ctx)
|
565
|
+
parts = tree.values if isinstance(tree, ast.BoolOp) and isinstance(tree.op, ast.And) else [tree]
|
566
|
+
out = []
|
567
|
+
for p in parts:
|
568
|
+
code = ast.unparse(p)
|
569
|
+
val = eval(compile(ast.Expression(p), "<ast>", "eval"), ctx)
|
570
|
+
out.append(f"'{code}': {val}")
|
571
|
+
quick_print(f"Overall: {str(full).upper()}, " + ", ".join(out))
|
572
|
+
|
573
|
+
if_cond = if_condition
|
547
574
|
|
548
575
|
class k:
|
549
576
|
pass
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=gojKDAkm-H7AFGGc8d4guZSM25oIHP-V5cLDMZYjOMo,22910
|
2
|
+
kenenet-1.2.5.dist-info/METADATA,sha256=_5pplHx9bNTlk36KJv2Ke4QXrTNPHAmOFmxNZpmdnA0,1693
|
3
|
+
kenenet-1.2.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
kenenet-1.2.5.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-1.2.5.dist-info/RECORD,,
|
kenenet-1.2.3.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=4Elg3QQ7bTh2A01EMLnZh0li5OCLZpOXNOvk7doBz6Q,21857
|
2
|
-
kenenet-1.2.3.dist-info/METADATA,sha256=D8w7MBuzS1lpc-I70eMuJ38h7t_HDbShboZwe6WetVk,1693
|
3
|
-
kenenet-1.2.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
kenenet-1.2.3.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-1.2.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|