├── .github └── FUNDING.yml ├── Automated_Drawing.py ├── FAILSAFE ├── Fail_Safe.py └── text.txt └── PYAUTOGUI.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: codeofthefuture 2 | 3 | -------------------------------------------------------------------------------- /Automated_Drawing.py: -------------------------------------------------------------------------------- 1 | # Import the relevant modules 2 | import pyautogui 3 | import time 4 | 5 | # Spiral drawing using pyautogui 6 | time.sleep(3) 7 | distance = 300 8 | while distance > 0: 9 | pyautogui.dragRel(distance, 0, button="left") 10 | distance = distance - 20 11 | pyautogui.dragRel(0, distance, button="left") 12 | pyautogui.dragRel(-distance, 0, button="left") 13 | distance = distance - 20 14 | pyautogui.dragRel(0, -distance, button="left") 15 | # time.sleep(2) -------------------------------------------------------------------------------- /FAILSAFE/Fail_Safe.py: -------------------------------------------------------------------------------- 1 | # Import the relevant modules 2 | import pyautogui 3 | import time 4 | 5 | # FAIL-SAFE - DO NOT DISABLE THIS 6 | pyautogui.FAILSAFE = True 7 | 8 | # Example 9 | time.sleep(3) 10 | text = open("text.txt") 11 | for each_line in text: 12 | pyautogui.write(each_line) 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /FAILSAFE/text.txt: -------------------------------------------------------------------------------- 1 | hello 2 | hello 3 | hello 4 | hello 5 | hello 6 | hello 7 | hello 8 | hello 9 | hello 10 | hello 11 | hello 12 | hello 13 | hello 14 | hello 15 | hello 16 | hello 17 | hello 18 | hello 19 | hello 20 | hello 21 | hello 22 | hello 23 | hello 24 | hello 25 | hello 26 | hello 27 | -------------------------------------------------------------------------------- /PYAUTOGUI.py: -------------------------------------------------------------------------------- 1 | # Import the relevant modules 2 | import pyautogui 3 | import time 4 | 5 | # Give the python file some time before continuing 6 | time.sleep(3) 7 | 8 | # Mouse Functions 9 | # Prints the resolution of your screen 10 | print(pyautogui.size()) 11 | # Prints the current position of the mouse 12 | print(pyautogui.position()) 13 | # Moves the mouse over time (3 seconds) 14 | pyautogui.moveTo(100, 100, 3) 15 | # Move the mouse relative to its current position 16 | pyautogui.moveRel(100, 100, 3) 17 | 18 | # Click 19 | pyautogui.click(500, 500, 3, 3, button="left") 20 | pyautogui.tripleClick() 21 | pyautogui.doubleClick() 22 | pyautogui.leftClick() 23 | pyautogui.rightClick() 24 | 25 | # Scrolls up 500 26 | pyautogui.scroll(500) 27 | # Scrolls down 500 28 | pyautogui.scroll(-500) 29 | 30 | # Mouse up and down 31 | pyautogui.mouseUp(100, 100, button="left") 32 | pyautogui.mouseDown(100, 100, button="left") 33 | 34 | # Example of mouse up and down 35 | pyautogui.mouseDown(300, 400, button="left") 36 | pyautogui.moveTo(800, 400, 3) 37 | pyautogui.mouseUp() 38 | pyautogui.moveTo(1000, 400, 3) 39 | 40 | # Intermittent drawing of lines on paint - NOT MENTIONED IN YOUTUBE VIDEO 41 | time.sleep(3) 42 | pyautogui.mouseDown(300, 400, button='left') 43 | pyautogui.moveTo(500, 400) 44 | pyautogui.mouseUp() 45 | pyautogui.moveTo(700, 400) 46 | pyautogui.mouseDown() 47 | pyautogui.moveTo(900, 400) 48 | 49 | 50 | # Spiral drawing using pyautogui 51 | time.sleep(1) 52 | distance = 300 53 | while distance > 0: 54 | pyautogui.dragRel(distance, 0, 1, button="left") 55 | distance = distance - 20 56 | pyautogui.dragRel(0, distance, 1, button="left") 57 | pyautogui.dragRel(-distance, 0, 1, button="left") 58 | distance = distance - 20 59 | pyautogui.dragRel(0, -distance, 1, button="left") 60 | time.sleep(4) 61 | 62 | 63 | # TikTok Liker - example 64 | time.sleep(3) 65 | # range will be the number of TikTok's you want to like 66 | for i in range(10): 67 | pyautogui.moveTo(450, 500) 68 | time.sleep(1) 69 | pyautogui.doubleClick() 70 | time.sleep(1) 71 | pyautogui.moveTo(854, 515) 72 | time.sleep(1) 73 | pyautogui.leftClick() 74 | 75 | 76 | # Keyboard functions 77 | pyautogui.write("hello") 78 | pyautogui.press("enter") 79 | pyautogui.press("space") 80 | 81 | # Dino Game - Chrome 82 | time.sleep(3) 83 | for i in range(20): 84 | pyautogui.press("space") 85 | time.sleep(0.5) 86 | 87 | # Screenshot in pyautogui 88 | pyautogui.screenshot("screenshot.png") 89 | 90 | 91 | 92 | 93 | 94 | --------------------------------------------------------------------------------