-
Notifications
You must be signed in to change notification settings - Fork 0
/
2020-5-12_DinoNaive.py
42 lines (34 loc) · 1.07 KB
/
2020-5-12_DinoNaive.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
from numpy import *
from time import sleep
from PIL import ImageGrab,ImageOps
import pyautogui as py
def pressSpace():
py.keyDown('space')
py.keyUp('space')
def IMG(x,y,w,h):
Box=(x,y,w,h) #Use your own Coordinates here
image=ImageGrab.grab(Box)
image=ImageOps.grayscale(image)
arr=array(image.getcolors())
print(arr.sum())
return(arr.sum())
def start(a,b,c,d):
print("Starting Game.....")
x=0
while(x<=65):
if(IMG(a,b,c,d)!=6558 and IMG(a,b,c,d)!=6780):
pressSpace()
x+=1
print(" Jumping "+str(x)+" times")
while(x<=85):
if(IMG(a,b,c+100,d)!=11058 and IMG(a,b,c+100,d)!=11280):
pressSpace()
x+=10
print(" Jumping "+str(x)+" times")
while(x<=485):
if(IMG(a,b,c+150,d)!=13308 and IMG(a,b,c+150,d)!=13530):
pressSpace()
x+=1
print(" Jumping "+str(x)+" times")
if __name__ == "__main__":
start(80,405,225,450)