-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathmain.py
249 lines (202 loc) · 8.71 KB
/
main.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
from selenium import webdriver
import os, time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
import sys
import colorama
from colorama import Fore, Back, Style
colorama.init()
# config
# change the directory to your chrome driver. for more instructions read the readme file.os
PATH = ('C:\\Program Files (x86)\\Chrome\\Application\\chromedriver.exe')
driver = webdriver.Chrome(PATH)
def main4(argv):
lesson = input('Enter lesson link for algerba')
while True:
driver.get(lesson)
time.sleep(4)
driver.refresh()
time.sleep(4)
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
q2 = q1.text
print(repr(q2))
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
time.sleep(4)
#change this
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div[2]')
ans = answer.text
print(ans)
driver.delete_all_cookies()
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
def main1(argv):
lesson = input('Enter an 8th grade lesson link')
while True:
driver.get(lesson)
time.sleep(4)
driver.refresh()
time.sleep(4)
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
q2 = q1.text
print(repr(q2))
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
time.sleep(4)
#change this
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div/div[9]')
ans = answer.text
print(ans)
driver.delete_all_cookies()
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
def main2(argv):
lesson = input('Please Enter A 7th Grade Lesson Link: ')
while True:
driver.get(lesson)
time.sleep(4)
driver.refresh()
time.sleep(4)
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
q2 = q1.text
print(repr(q2))
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
time.sleep(4)
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div/div')
ans = answer.text
print(ans)
driver.delete_all_cookies()
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
# 6th Grade
def main3(argv):
lesson = input('Please Enter A 6th Grade Lesson Link: ')
while True:
driver.get(lesson)
time.sleep(4)
driver.refresh()
time.sleep(4)
q1 = driver.find_element_by_class_name('yui3-practiceagent-content')
q2 = q1.text
print(repr(q2))
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[1]/div/div[2]/button').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/button[2]').click()
time.sleep(4)
answer = driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[4]/div[2]/div/div/div/div')
ans = answer.text
print(ans)
driver.delete_all_cookies()
driver.find_element_by_xpath('/html/body/div[9]/section/div[1]/div[1]/div[6]/div/div[8]/div/div[1]/div[1]/div[2]/button').click()
def op1():
os.system('cls' if os.name == 'nt' else 'clear')
print('If any of these are incorrect, bot will fail.')
username = input('Enter Username or Email: ')
password = input('Enter Password: ')
os.system('cls' if os.name == 'nt' else 'clear')
print('do not touch the window that has just popped up. ')
print('smart score goes up and down alot, just go afk or do something in background!')
driver.get('https://www.ixl.com/math/grade-7/add-and-subtract-integers')
time.sleep(3)
driver.refresh()
driver.find_element_by_xpath('//*[@id="qlusername"]').send_keys(username)
driver.find_element_by_xpath('//*[@id="qlpassword"]').send_keys(password)
driver.find_element_by_xpath('//*[@id="qlsubmit"]').click()
driver.execute_script('''window.open('',"_blank");''')
driver.switch_to.window(driver.window_handles[-1])
driver.get('https://www.meta-calculator.com/scientific-calculator.php?panel-203-simple-calculator')
driver.switch_to.window(driver.window_handles[0])
while True:
time.sleep(3)
variable = driver.find_element_by_class_name('old-space-indent').text
print(variable)
driver.switch_to.window(driver.window_handles[-1])
box = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input')
time.sleep(3)
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input').send_keys(variable)
answer = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/input')
box.send_keys(Keys.BACKSPACE)
print('the bot will now pause for 150 seconds to generate some time.')
time.sleep(150)
box.send_keys(Keys.ENTER)
answer = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[1]/span[2]').text
a = (answer)
c = "="
for char in c:
a = a.replace(char, "")
print(a)
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div[1]/div[2]/div[2]/div[4]/div[1]/div[2]/button[2]').click()
driver.switch_to.window(driver.window_handles[0])
driver.find_element_by_class_name('fillIn').click()
driver.find_element_by_class_name('fillIn').send_keys(a)
time.sleep(3)
driver.find_element_by_class_name('fillIn').send_keys(Keys.ENTER)
driver.refresh()
def op2():
os.system('cls' if os.name == 'nt' else 'clear')
grade = input('Are you in 8th Grade? (Y/N): ')
if grade == "Y":
main1(sys.argv)
print('You are In 8th Grade')
print('You will be asked to Enter Your Lesson Link')
else:
grade2 = input('Are you in 7th Grade? (Y/N): ')
if grade2 == "Y":
main2(sys.argv)
print('You are In 7th Grade')
print('You will be asked to Enter Your Lesson Link')
else:
grade3 = input('Are you in 6th Grade? (Y/N): ')
if grade3 == "Y":
print('You are In 6th Grade')
print('You will be asked to Enter Your Lesson Link')
main3(sys.argv)
else:
print('algerba')
main4(sys.argv)
def op4():
os.system('cls' if os.name == 'nt' else 'clear')
print('If any of these are incorrect, bot will fail.')
username = input('Enter Username or Email: ')
password = input('Enter Password: ')
os.system('cls' if os.name == 'nt' else 'clear')
def op5():
os.system('cls' if os.name == 'nt' else 'clear')
print('If any of these are incorrect, bot will fail.')
username = input('Enter Username or Email: ')
password = input('Enter Password: ')
os.system('cls' if os.name == 'nt' else 'clear')
def main():
print('Menu: ')
print('1. Add more time to your account')
print('2. Scrape Answers (get answers)')
print('3. Get Teacher Accounts')
print('4. Auto Answer (some lessons work)')
print('5. Credits')
var = input('Enter an Option: ')
# goes to the specified option
if var==('1'):
op1()
elif var==('2'):
op2()
elif var==('3'):
op3()
elif var==('4'):
op4()
elif var==('5'):
op5()
else:
print('Please enter numbers only. If you did and still got an error, please enter a number which is listed above.')
time.sleep(4)
os.system('cls' if os.name == 'nt' else 'clear')
main()
# end code
print('Welcome to The First Functional IXL BOT.')
print('DO NOT CLOSE THE CHROME WINDOW THAT IS ABOUT TO POP UP.')
print('Please wait..')
time.sleep(3)
os.system('cls' if os.name == 'nt' else 'clear')
main()