Skip to content

Commit

Permalink
Updated package information
Browse files Browse the repository at this point in the history
  • Loading branch information
mochiron-desu committed Jan 26, 2024
1 parent 691efd3 commit 5630dda
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
Binary file modified commands/__pycache__/mouse_movement.cpython-311.pyc
Binary file not shown.
28 changes: 15 additions & 13 deletions commands/mouse_movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import datetime
from PIL import ImageGrab
import time

DATA_JSON_PATH = "D:\Coding\Discord bots\python-windows-bot\data\data.json"
SCREENSHOT_PATH = "D:\Coding\Discord bots\python-windows-bot\data\mouse-ss.png"
Expand Down Expand Up @@ -47,18 +48,19 @@ async def monitor_mouse_movement(client, config, starting_mouse_position):
current_mouse_position = pyautogui.position()

if current_mouse_position != previous_mouse_position:
current_time = int(time.time())
print(f"[mouse_movement_LOG] - {last_movement_time} : Mouse Movement Detected.")
message = f"Mouse moved to `{current_mouse_position[0]}`, `{current_mouse_position[1]}`"
message = f"Mouse moved to `{current_mouse_position[0]}`, `{current_mouse_position[1]}` at "+f'<t:{current_time}>'
last_movement_time = datetime.datetime.now().strftime("%d-%m-%Y %H:%M:%S")

try:
screenshot = ImageGrab.grab(
bbox=(
current_mouse_position[0] - 400,
current_mouse_position[1] - 300,
current_mouse_position[0] + 400,
current_mouse_position[1] + 300,
)
# bbox=(
# current_mouse_position[0] - 400,
# current_mouse_position[1] - 300,
# current_mouse_position[0] + 400,
# current_mouse_position[1] + 300,
# )
)

screenshot.save(SCREENSHOT_PATH)
Expand All @@ -69,12 +71,12 @@ async def monitor_mouse_movement(client, config, starting_mouse_position):



# Check if image_message is not None and attempt to delete it if it exists
if image_message:
try:
await image_message.delete()
except discord.NotFound:
pass # Message already deleted or not found
# # Check if image_message is not None and attempt to delete it if it exists
# if image_message:
# try:
# await image_message.delete()
# except discord.NotFound:
# pass # Message already deleted or not found

image_message = await log_channel.send(
message, file=discord.File(SCREENSHOT_PATH)
Expand Down
12 changes: 11 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@ aiohttp==3.8.5
aiosignal==1.3.1
async-timeout==4.0.3
attrs==23.1.0
blinker==1.6.3
charset-normalizer==3.2.0
click==8.1.7
colorama==0.4.6
discord.py==2.3.2
dnspython==2.4.2
EasyProcess==1.1
entrypoint2==1.1
Flask==3.0.0
frozenlist==1.4.0
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
MouseInfo==0.1.3
mss==9.0.1
multidict==6.0.4
Pillow==10.0.1
pillow==10.2.0
PyAutoGUI==0.9.54
PyGetWindow==0.0.9
pymongo==4.5.0
PyMsgBox==1.0.9
pyperclip==1.8.2
PyRect==0.2.0
pyscreenshot==3.1
PyScreeze==0.1.29
pytweening==1.0.7
Werkzeug==3.0.0
yarl==1.9.2

0 comments on commit 5630dda

Please sign in to comment.