-
Notifications
You must be signed in to change notification settings - Fork 0
/
PGeneric - Experimental.py
117 lines (104 loc) · 2.65 KB
/
PGeneric - Experimental.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import pyautogui
import time
from random import *
import winsound
import os
def intro():
random = 0
inn = input("How Many times should I run this code?")
time.sleep(5)
while (int(random) < int(inn)):
execute()
#print("CURRENT RANDOM VALUE = " + str(random))
random = random + 1
def execute():
global hours
global minutes
hours = randint(1, 12)
minutes = randint(1, 59)
#seconds = randint(1, 59)
#pyautogui.typewrite(str(hours))
hour()
tab()
#pyautogui.typewrite(str(minutes))
minute()
tab()
#pyautogui.typewrite(str(seconds))
#tab()
AMPM()
tab()
tab()
tab()
tab()
def hour():
if (hours == 1):
pyautogui.typewrite('01')
if (hours == 2):
pyautogui.typewrite('02')
if (hours == 3):
pyautogui.typewrite('03')
if (hours == 4):
pyautogui.typewrite('04')
if (hours == 5):
pyautogui.typewrite('05')
if (hours == 6):
pyautogui.typewrite('06')
if (hours == 7):
pyautogui.typewrite('07')
if (hours == 8):
pyautogui.typewrite('08')
if (hours == 9):
pyautogui.typewrite('09')
else:
pyautogui.typewrite(str(hours))
def minute():
if (minutes == 1):
pyautogui.typewrite('01')
if (minutes == 2):
pyautogui.typewrite('02')
if (minutes == 3):
pyautogui.typewrite('03')
if (minutes == 4):
pyautogui.typewrite('04')
if (minutes == 5):
pyautogui.typewrite('05')
if (minutes == 6):
pyautogui.typewrite('06')
if (minutes == 7):
pyautogui.typewrite('07')
if (minutes == 8):
pyautogui.typewrite('08')
if (minutes == 9):
pyautogui.typewrite('09')
else:
pyautogui.typewrite(str(minutes))
def AMPM():
if (hours == 1) or (hours == 2) or (hours == 3) or (hours == 4) or (hours == 5) or (hours == 6) or (hours == 12):
pyautogui.typewrite("PM")
else:
pyautogui.typewrite("AM")
def tab():
pyautogui.press('tab')
def beep():
winsound.PlaySound("SystemAsterisk", winsound.SND_ALIAS)
def end():
beep()
print("The script has ended")
def cls():
os.system('cls')
def do_task():
intro()
cls()
end()
cls()
rerun()
def rerun():
while True:
ans = input("Do you want to go again? Press Y or N.").upper()
if ans == "Y":
do_task()
if ans == "N":
print("Goodbye!")
time.sleep(1.5)
quit()
do_task()