-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.py
50 lines (40 loc) · 952 Bytes
/
ui.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
import numpy as np
import pyscreenshot as ImageGrab
import cv2
#import pytesseract
import tkinter
from selenium import webdriver
from pynput.mouse import Listener
num = 0
fromx = 0
fromy = 0
tox = 10
toy = 10
def on_click(x,y, button, pressed):
global num, fromx, fromy, tox, toy
num = num +1
if (num % 2) == 0:
tox = x
toy = y
else:
fromx = x
fromy = y
#print("{} {} {} {}".format(fromx,fromy,tox,toy))
while (1):
image = ImageGrab.grab(bbox=(fromx,fromy,tox,toy))
imagenp = np.array(image.getdata(),dtype='uint8').reshape((image.size[1],image.size[0],3))
cv2.imshow('window', imagenp)
with Listener(on_click=on_click) as listener:
listener.join()
"""
window = tkinter.Tk()
window.title("GoldDigger")
label = tkinter.Label (window, text = "Hello World").pack()
window.mainloop()
"""
"""
driver = webdriver.Firefox()
driver.get('https://paytm.com/digitalgold')
driver.save_screenshot("screenshot.png")
#driver.close()
"""