zhmiscellany 5.7.0__py3-none-any.whl → 5.7.2__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.
zhmiscellany/macro.py CHANGED
@@ -16,7 +16,9 @@ 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):
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):
20
+ if not click:
21
+ act_start=False;act_end=False
20
22
  if relative:
21
23
  ensure_movement = False
22
24
  if right_click and middle_click:
@@ -43,7 +45,10 @@ def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_c
43
45
  if animation_time:
44
46
  mxy = get_mouse_xy()
45
47
  start = mxy
46
- end = (x, y)
48
+ if not relative:
49
+ end = (x, y)
50
+ else:
51
+ end = tuple(a + b for a, b in zip(start, (x,y)))
47
52
  num_points = animation_fps*animation_time # 60 fps animation
48
53
  num_points += 2 # don't need start and end points
49
54
  num_points = math.ceil(num_points)
@@ -64,8 +69,10 @@ def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_c
64
69
  temp.append(relative_point)
65
70
  animation_points = temp
66
71
 
67
- animation_points.pop() # remove start and end
72
+ # remove start and end
68
73
  animation_points.pop(0)
74
+ if not relative:
75
+ animation_points.pop()
69
76
  for point in animation_points:
70
77
  click_pixel((round(point[0]), round(point[1])), act_start=False, act_end=False, click_end_duration=1/animation_fps, relative=relative)
71
78
 
@@ -93,7 +100,8 @@ def click_pixel(x=None, y=None, click_duration=None, right_click=False, middle_c
93
100
  else:
94
101
  break
95
102
  else:
96
- move_mouse(cx, cy, relative=relative)
103
+ if not (animation_time and relative):
104
+ move_mouse(cx, cy, relative=relative)
97
105
 
98
106
  if pre_click_duration:
99
107
  if pre_click_wiggle:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 5.7.0
3
+ Version: 5.7.2
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
@@ -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=A5_1WbChuLAQeqNCcM6-Y9NMuuo8kIUZDiTbW77xk0U,15247
15
+ zhmiscellany/macro.py,sha256=7oMnrIUfFNOxRKafv3mY5IKHVziZdsRT_cSmLmBjRPY,15517
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.0.dist-info/METADATA,sha256=va_LTi9QxX9dgp21q1iOEn48cuJ7AJebImdPnWO6u3Y,42153
25
- zhmiscellany-5.7.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
- zhmiscellany-5.7.0.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-5.7.0.dist-info/RECORD,,
24
+ zhmiscellany-5.7.2.dist-info/METADATA,sha256=yXU8bT4A34FXS8P5wqm1XDmIKgQ1IJLvnCPYLOXcFUg,42153
25
+ zhmiscellany-5.7.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
+ zhmiscellany-5.7.2.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
+ zhmiscellany-5.7.2.dist-info/RECORD,,