zhmiscellany 5.7.5__py3-none-any.whl → 5.7.8__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.
@@ -124,6 +124,7 @@ SCREEN_WIDTH, SCREEN_HEIGHT = get_actual_screen_resolution()
124
124
  calibrated = False
125
125
 
126
126
  def move_mouse(x: int, y: int, relative=False):
127
+ calibrate()
127
128
  if not relative:
128
129
  # Convert coordinates to normalized coordinates (0-65535)
129
130
  normalized_x = int(x * (65535 / SCREEN_WIDTH))
@@ -161,16 +162,20 @@ def get_mouse_xy():
161
162
  x, y = win32api.GetCursorPos()
162
163
  return x, y
163
164
 
164
- # calibrate relative movement, required because windows is weird
165
- original_mouse_point = get_mouse_xy()
166
- calibration_distance = 128
167
- move_mouse(0,0)
168
- move_mouse(calibration_distance, calibration_distance, relative=True)
169
- moved_pos = get_mouse_xy()
170
- calibration_multiplier_x = calibration_distance/moved_pos[0]
171
- calibration_multiplier_y = calibration_distance/moved_pos[1]
172
- calibrated = True
173
- move_mouse(original_mouse_point[0]+1, original_mouse_point[1]+1)
165
+ def calibrate():
166
+ global calibration_multiplier_x, calibration_multiplier_y, calibrated
167
+ if calibrated:
168
+ return
169
+ # calibrate relative movement, required because windows is weird
170
+ original_mouse_point = get_mouse_xy()
171
+ calibration_distance = 128
172
+ move_mouse(0,0)
173
+ move_mouse(calibration_distance, calibration_distance, relative=True)
174
+ moved_pos = get_mouse_xy()
175
+ calibration_multiplier_x = calibration_distance/moved_pos[0]
176
+ calibration_multiplier_y = calibration_distance/moved_pos[1]
177
+ calibrated = True
178
+ move_mouse(original_mouse_point[0]+1, original_mouse_point[1]+1)
174
179
 
175
180
 
176
181
  def mouse_down(button: int):
zhmiscellany/discord.py CHANGED
@@ -290,7 +290,7 @@ def ids_to_message_url(channel_id, message_id, guild_id=None):
290
290
  if guild_id:
291
291
  return f'https://discord.com/channels/{guild_id}/{channel_id}/{message_id}'
292
292
  else:
293
- return f'https://discord.com/channels/{channel_id}/{message_id}'
293
+ return f'https://discord.com/channels/@me/{channel_id}/{message_id}'
294
294
 
295
295
 
296
296
  def message_url_to_ids(message_url):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 5.7.5
3
+ Version: 5.7.8
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,13 +1,13 @@
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=UvD7aFofx-0XlLKS01j81K2afHGtt8usb9-UdNCQCa4,6730
4
+ zhmiscellany/_misc_supportfuncs.py,sha256=B8GOc70uOcccvyV8u1hQNyhiyFIikBBxtTG92e9LNfA,6916
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
8
8
  zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
9
9
  zhmiscellany/dict.py,sha256=0BZJ5eK-MurAHYV1OPa0jdGTr-QEWos7ZM0npb-tN9I,81
10
- zhmiscellany/discord.py,sha256=9Fvl9h99VT6z5jUS9_bdRSh0tvxS6p37rm4lxbLKpfw,19334
10
+ zhmiscellany/discord.py,sha256=bq4fBBIykQrwBKWeJ_Ia5ZtMjP9RfRheOa7fyWZBNjo,19338
11
11
  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
@@ -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.5.dist-info/METADATA,sha256=K4pzBjf_dXgSDqsVkY-2bftAlkf2WtEjwKyvq4pM7ss,42153
25
- zhmiscellany-5.7.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
- zhmiscellany-5.7.5.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-5.7.5.dist-info/RECORD,,
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,,