-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.py
102 lines (98 loc) · 5.06 KB
/
Menu.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
import URLGen
import refresher
class Menu(object):
def __init__(self):
self.choice = 0 # GLOBAL CHOICE VARIABLE
def description(self):
url = ""
while self.choice < 1 or self.choice > 3:
print("BOON BOT")
print("--------")
print("1.Buying Bot")
print("2.URL Generator")
print("3.Support & Information")
self.choice = input('\nPlease enter the number(1-3): ')
# ERR-INPUT-CHECKING-------------------------------------------------
if len(self.choice) == 0 or len(self.choice) > 1:
self.choice = 0
print("ERR:INVALID CHOICE\n\nPlease choose one of the following")
elif 47 < ord(self.choice) < 58:
self.choice = int(self.choice)
else:
self.choice = 0
print("ERR:INVALID CHOICE\n\nPlease choose one of the following")
# ERR-INPUT-CHECKING-------------------------------------------------
# BUYING-MENU-------------------------------------------------------------
if self.choice == 1: # BUYING
print("\nBUYING BOT")
print("----------")
url = input("Please enter the URL:")
refresher.buyBot(url)
# print("If the item cannot yet be bought, then you can set up the refresh rate")
# choice = input("Do you want to enter the refresh rate?(y/n)")
# if choice == "y":
# waitAmount = input("Enter the refresh rate: ")
# check = refresher.buyBot(url, waitAmount)
# elif choice == "n":
# check = refresher.buyBot(url, 0)
# else:
# self.choice = 0
# print("ERR:INVALID CHOICE")
# BUYING-MENU-------------------------------------------------------------
# URL-MENU-START----------------------------------------------------------
elif self.choice == 2: # URL GENERATOR
webChoice = 0
while webChoice < 1 or webChoice > 3:
print("\nURL GENERATOR")
print("-------------")
print("1.Adidas")
# print("2.Nike")
print("2.Request other websites")
print("3.Return to the previous page")
webChoice = input('\nPlease enter the number(1-4): ')
# ERR-INPUT-CHECKING-------------------------------------------------
if len(webChoice) == 0 or len(webChoice) > 1:
webChoice = 0
print("ERR:INVALID CHOICE\n\nPlease choose one of the following")
elif 47 < ord(webChoice) < 58:
webChoice = int(webChoice)
else:
webChoice = 0
print("ERR:INVALID CHOICE\n\nPlease choose one of the following")
# ERR-INPUT-CHECKING-------------------------------------------------
if webChoice == 1:
Model = input('Model #: ')
Size = float(input('Size(For women size please enter one size lower): '))
gen = URLGen.Generator()
url = gen.AdidasURL(Model, Size)
print("\nYOUR ADIDAS URL:")
print(url)
input("\n\nPress Enter to return...")
self.choice = 0
print("\nRETURNING\n")
# elif webChoice == 2:
# print("\nYOUR NIKE URL:")
# print(url)
# input("\n\nPress Enter to return...")
# self.choice = 0
# print("\nRETURNING\n")
elif webChoice == 2:
print("Please contact email for more support on specific site(s)"
"\nSupport Email: booniiz80@gmail.com")
input("\n\nPress Enter to return...")
self.choice = 0
print("\nRETURNING\n")
elif webChoice == 3:
self.choice = 0
print("\nRETURNING\n")
else:
print("ERR:INVALID CHOICE\n\nPlease choose one of the following")
# URL-MENU-END------------------------------------------------------------
elif self.choice == 3: # INFORMATION
print("Creator: Boon Chantachaimongkon")
print("Support Email: booniiz80@gmail.com")
input("\n\nPress Enter to return...")
self.choice = 0
print("\nRETURNING\n")
else: # ERR: INVALID INPUT
print("ERR:INVALID CHOICE\nPlease choose one of the following option")