-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a Python script for M.1 In 8th grade
- Loading branch information
1 parent
794a992
commit d35a4ff
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |