-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpa_template.py
44 lines (37 loc) · 960 Bytes
/
rpa_template.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
# -*- coding: utf-8 -*-
"""
This script is a template for creating simple RPA apps.
"""
import time
import pyautogui
import sys
import random
def type_messages():
time.sleep(3)
for i in range (10):
pyautogui.typewrite("Hello world")
pyautogui.press('enter')
def displaypos():
while True:
time.sleep(1)
pointing_at = pyautogui.position()
print (pointing_at)
def keep_active():
time.sleep(1)
while True:
noise=random.randint(-20, 20)
pyautogui.click(clicks=3,interval=1)
pyautogui.move(noise,-50, duration=0.5)
time.sleep(3)
pyautogui.click(clicks=3,interval=1)
pyautogui.move(-(noise),50, duration=0.5)
time.sleep(3)
# This will prevent screen from locking
print('Press Ctrl-C to quit.')
try:
while True:
keep_active()
except KeyboardInterrupt:
print ('\n')
# To see current mouse position use below
# displaypos()