zhmiscellany 5.7.8__py3-none-any.whl → 5.8.0__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.
@@ -122,14 +122,15 @@ def get_actual_screen_resolution():
122
122
  SCREEN_WIDTH, SCREEN_HEIGHT = get_actual_screen_resolution()
123
123
 
124
124
  calibrated = False
125
+ calipass = False
125
126
 
126
127
  def move_mouse(x: int, y: int, relative=False):
127
- calibrate()
128
128
  if not relative:
129
129
  # Convert coordinates to normalized coordinates (0-65535)
130
130
  normalized_x = int(x * (65535 / SCREEN_WIDTH))
131
131
  normalized_y = int(y * (65535 / SCREEN_HEIGHT))
132
132
  else:
133
+ calibrate()
133
134
  if calibrated:
134
135
  normalized_x = math.ceil(x * calibration_multiplier_x)
135
136
  normalized_y = math.ceil(y * calibration_multiplier_y)
@@ -163,9 +164,12 @@ def get_mouse_xy():
163
164
  return x, y
164
165
 
165
166
  def calibrate():
166
- global calibration_multiplier_x, calibration_multiplier_y, calibrated
167
+ global calibration_multiplier_x, calibration_multiplier_y, calibrated, calipass
167
168
  if calibrated:
168
169
  return
170
+ if calipass:
171
+ return
172
+ calipass = True
169
173
  # calibrate relative movement, required because windows is weird
170
174
  original_mouse_point = get_mouse_xy()
171
175
  calibration_distance = 128
zhmiscellany/macro.py CHANGED
@@ -16,7 +16,7 @@ import time
16
16
  get_mouse_xy = get_mouse_xy
17
17
 
18
18
 
19
- def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_click=False, shift=False, ctrl=False, act_start=True, act_end=True, click_end_duration=None, double_click=False, animation_time=None, animation_fps=60, animation_easing=True, relative=False, ensure_movement=True, pre_click_duration=None, pre_click_wiggle=False, click=True):
19
+ def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_click=False, shift=False, ctrl=False, act_start=True, act_end=True, click_end_duration=None, double_click=False, animation_time=None, animation_fps=60, animation_easing=True, relative=False, ensure_movement=True, pre_click_duration=None, pre_click_wiggle=True, post_click_duration=None, post_click_wiggle=True, click=True):
20
20
  if not click:
21
21
  act_start=False;act_end=False
22
22
  if right_click and middle_click:
@@ -169,6 +169,14 @@ def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_c
169
169
  for key in keys_down:
170
170
  win32api.keybd_event(key, 0, win32con.KEYEVENTF_KEYUP, 0)
171
171
 
172
+ if post_click_duration:
173
+ if post_click_wiggle:
174
+ num_wiggle = round(animation_fps * post_click_duration)
175
+ for i in range(num_wiggle):
176
+ click_pixel(cx+((random.randint(0, 1)*2)-1), cy+((random.randint(0, 1)*2)-1), act_start=False, act_end=False, click_end_duration=1 / animation_fps)
177
+ else:
178
+ zhmiscellany.misc.high_precision_sleep(post_click_duration)
179
+
172
180
  if click_end_duration:
173
181
  zhmiscellany.misc.high_precision_sleep(click_end_duration)
174
182
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 5.7.8
3
+ Version: 5.8.0
4
4
  Summary: A collection of useful/interesting python libraries made by zh.
5
5
  Home-page: https://discord.gg/ThBBAuueVJ
6
6
  Author: zh
@@ -1,7 +1,7 @@
1
1
  zhmiscellany/__init__.py,sha256=Oh3gAJRWq2aUEgkolmQyiZOQ3iey5OC4NA2XaTHuVv4,1139
2
2
  zhmiscellany/_discord_supportfuncs.py,sha256=RotSpurqFtL5q6v_ST1e2Y_1qJMaHp1CDsF5i-gR4ec,6524
3
3
  zhmiscellany/_fileio_supportfuncs.py,sha256=OIboEBVahqbpG1wbtrhAjoFV-oPylFVmOENOByawaX0,365
4
- zhmiscellany/_misc_supportfuncs.py,sha256=B8GOc70uOcccvyV8u1hQNyhiyFIikBBxtTG92e9LNfA,6916
4
+ zhmiscellany/_misc_supportfuncs.py,sha256=y5hlFjenJTrEPjR9VH0F7X9JhUWSV-Gx-fahNzyMMU8,7003
5
5
  zhmiscellany/_processing_supportfuncs.py,sha256=aZKWIfJW_lVaQs_EyGGBhmoMc6btA38X2hY6A3kTxN8,10341
6
6
  zhmiscellany/_py_resources.py,sha256=HqJs5aRLymLZ2J5Io8g6bY58pGWhN9b8vCktC2DW4KQ,229009
7
7
  zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWHt4xrOG5l0,856
@@ -12,7 +12,7 @@ zhmiscellany/fileio.py,sha256=KmRnWWZJWBc5Or3_mKcRY2ehE_Fuk870iS-imtyERyg,18169
12
12
  zhmiscellany/gui.py,sha256=VgT5j5UIr-wWyL2P1qCHSNL7RrvZWDlm0TX00JGWmKo,7404
13
13
  zhmiscellany/image.py,sha256=qUjxiYpc2VVZp2vwr1vN36O2PVQ7YlMKzhegQ1u4c0M,8198
14
14
  zhmiscellany/list.py,sha256=S8Z85bLJEP9lk2JkGpzUcG6kpRB7a-NWDIHMPiF5bKo,1473
15
- zhmiscellany/macro.py,sha256=cerHp2YZGGDr-d7r__PV346TNOiW_GY9NecDwx678Pw,16857
15
+ zhmiscellany/macro.py,sha256=yC2coCCHq7lg8bD9QV1ZNeeyhkWI9BNWW0YOsiEWhHA,17331
16
16
  zhmiscellany/math.py,sha256=btOQTe_GvqP0A7Zz84tmN_c8j1NGe_mKnhmAt40lhLU,2482
17
17
  zhmiscellany/misc.py,sha256=BsTbRWlXI5LZBG7Bl2MgLzHESyCMJnr_KNZAf2wY_H4,29689
18
18
  zhmiscellany/netio.py,sha256=GTamo5cJn4P6u8V_kgZ9kL8qeMUE7OQAmYkmj9Sp_GA,2236
@@ -21,7 +21,7 @@ zhmiscellany/pipes.py,sha256=PxO4aykFzC60xbTQuc66KzZYIxiW0KPebXZbncD2HcU,3795
21
21
  zhmiscellany/processing.py,sha256=srwlV8FZ--svF5e6rZZxhIs_6ZjOAwq2OcQEf6T2Le8,10410
22
22
  zhmiscellany/rust.py,sha256=znN6DYNoa_p-braTuDZKvUnXX8reWLFu_dG4fv2vLR0,442
23
23
  zhmiscellany/string.py,sha256=xyqE6V5YF2nieZDcg5ZrXTIrH2D9oDRbZ5vQGz8rPys,4787
24
- zhmiscellany-5.7.8.dist-info/METADATA,sha256=cSl5z6rJKkefoYL4vz0ZQg_OctaTqGBb9EbyVH60TZQ,42153
25
- zhmiscellany-5.7.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
- zhmiscellany-5.7.8.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-5.7.8.dist-info/RECORD,,
24
+ zhmiscellany-5.8.0.dist-info/METADATA,sha256=aFcYkBu7TY9a25dNorkkgbXvYXXjLJrUoGXDW-ieJ70,42153
25
+ zhmiscellany-5.8.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
+ zhmiscellany-5.8.0.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
+ zhmiscellany-5.8.0.dist-info/RECORD,,