Skip to content

Commit 977b5ef

Browse files
authored
Create AutoMSRewards.py
The main Python file for searching
0 parents  commit 977b5ef

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

AutoMSRewards.py

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#! /usr/bin/env python
2+
import pyautogui as p
3+
import time
4+
import random
5+
from hashlib import sha256
6+
7+
def search(query):
8+
p.hotkey("ctrl","e")
9+
time.sleep(.1)
10+
p.write(query)
11+
p.press("enter")
12+
time.sleep(.67)
13+
14+
def imageFind(image,g,double):
15+
a = 0
16+
b = 0
17+
while(a==0 and b==0):
18+
try:
19+
a,b = p.locateCenterOnScreen(image,confidence=0.65 ,grayscale=g)
20+
except TypeError:
21+
pass
22+
23+
if double == True:
24+
p.doubleClick(a,b)
25+
else:
26+
p.click(a,b)
27+
28+
return a,b
29+
30+
passw = p.password("Enter password: ")
31+
while(sha256(passw.encode('utf-8')).hexdigest() != "enter your account password hash here"):
32+
print("Wrong password")
33+
passw = p.password("Enter password: ")
34+
35+
p.hotkey("win","d")
36+
imageFind("Edge.JPG",False,True)
37+
time.sleep(3)
38+
p.hotkey("win","up")
39+
search("bing")
40+
time.sleep(5)
41+
42+
c,d = imageFind("SignIn.JPG",True,True)
43+
login = p.locateCenterOnScreen("LogIn.JPG",confidence=0.6, grayscale=True)
44+
45+
while(login == None):
46+
login = p.locateCenterOnScreen("LogIn.JPG",confidence=0.7, grayscale=True)
47+
48+
p.write("enter your email here")
49+
p.press("enter")
50+
51+
enterpassword = p.locateCenterOnScreen("EnterPassword.JPG",confidence=0.7, grayscale=True)
52+
while(enterpassword == None):
53+
enterpassword = p.locateCenterOnScreen("EnterPassword.JPG",confidence=0.7, grayscale=True)
54+
p.write(passw)
55+
for q in range(3):
56+
p.press("enter")
57+
time.sleep(1)
58+
59+
searchOps = "qwertyuiopasdfghjklzxcvbnm1234567890!\"£$%^&*()/-+.|¬`[];'#,/{}:@~<>?"
60+
searchQ = ""
61+
62+
for z in range(38):
63+
searchQ += searchOps[random.randint(0,len(searchOps)-1)]
64+
65+
for y in range(len(searchQ)):
66+
search(searchQ[:y])
67+
68+
time.sleep(2)
69+
imageFind("Rewards.JPG",True,False)
70+
71+
p.click(c,d)
72+
imageFind("LogOut.JPG",True,False)
73+
time.sleep(.5)
74+
p.hotkey("ctrl","w")

0 commit comments

Comments
 (0)