-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.py
46 lines (35 loc) · 1.34 KB
/
commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import webbrowser
import pyautogui
import time
from sys import platform
import random
def type_words(str, increment=0):
for x in str:
pyautogui.typewrite(x)
time.sleep(increment)
def type_words_into_tab(website: str, text: str):
webbrowser.open_new_tab(website)
time.sleep(3)
type_words(text)
def rick_roll(website: str = "https://www.youtube.com/watch?v=xm3YgoEiEDc"):
webbrowser.open_new_tab(website)
time.sleep(15)
pyautogui.moveTo(300,300)
pyautogui.click()
def win_closing():
if platform == "win32":
import win32gui, win32con
def callback(hwnd, extra):
if win32gui.IsWindowVisible(hwnd):
print(f"Window text: '{win32gui.GetWindowText(hwnd)}'")
def minimize_everything(hwnd, extra):
if win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowText(hwnd) != '':
win32gui.ShowWindow(hwnd, win32con.SW_MINIMIZE)
win32gui.EnumWindows(minimize_everything, None)
else:
type_words_into_tab("you think you may have bested me by not using Michealsoft Binbows®, but fear not HAHHAAHAHA")
def move_mouse_randomly():
while True:
pyautogui.moveTo(random.randint(0, pyautogui.size().width), random.randint(0, pyautogui.size().height))
def move_mouse_to_location(x: int, y: int):
pyautogui.moveTo(x, y)