Skip to content

Commit

Permalink
Added Python
Browse files Browse the repository at this point in the history
Added a Python script for M.1 In 8th grade
  • Loading branch information
EasyOnHard authored Feb 28, 2024
1 parent 794a992 commit d35a4ff
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
45 changes: 45 additions & 0 deletions python/8_M.1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import pyautogui
import time
import keyboard
from sys import exit

def mousepos():
print(pyautogui.position())

def test_macro():
time.sleep(0.35)
pyautogui.click(700, 500)
time.sleep(0.01)
pyautogui.click(900, 500)
time.sleep(0.01)
pyautogui.press('enter')
time.sleep(0.9)
pyautogui.click(1170, 530)
time.sleep(0.01)
pyautogui.click(1220, 660)
time.sleep(0.01)
pyautogui.click(1220, 715)
time.sleep(0.01)
pyautogui.click(1220, 745)

def infinite_macro():
while True:
time.sleep(0.35)
pyautogui.click(700, 500)
time.sleep(0.01)
pyautogui.click(900, 500)
time.sleep(0.01)
pyautogui.press('enter')
time.sleep(0.9)
pyautogui.click(1170, 530)
for i in range(7):
y = i * 20 + 600
pyautogui.click(1220,y)
if keyboard.is_pressed('ctrl + y'):
break

keyboard.add_hotkey('ctrl + m', lambda: mousepos())
keyboard.add_hotkey('ctrl + t', lambda: test_macro())
keyboard.add_hotkey('ctrl + i', lambda: infinite_macro())

keyboard.wait('esc')
11 changes: 11 additions & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MouseInfo==0.1.3
pillow==10.2.0
PyAutoGUI==0.9.54
PyGetWindow==0.0.9
PyMsgBox==1.0.9
pynput==1.7.6
pyperclip==1.8.2
PyRect==0.2.0
PyScreeze==0.1.30
pytweening==1.2.0
six==1.16.0

0 comments on commit d35a4ff

Please sign in to comment.