-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimgBot.py
48 lines (40 loc) · 1.13 KB
/
imgBot.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
#!/usr/bin/env python
'''
This Program is designed to find and click sequentially named images, this allows
us to create a generally adaptive bot by simply dragging images to the appropriate
folder and renaming them.
'''
import cv2
import numpy as np
# from matplotlib import pyplot as plt
import pyautogui
import random
import time
import os
from lib.imagesearch import *
__author__ = "Daniel Price-Dufek"
__version__ = "1.0.0"
__maintainer__ = "Daniel Price-Dufek"
__email__ = "[email protected]"
__status__ = "Development"
# finds images and clicks images in numbered order
def findImages():
index = 1
filename = 'images\\' + str(index) + '.png'
print(filename)
while(os.path.exists(filename)):
print(filename)
searchAndClick(filename)
filename = 'images\\' + str(index) + '.png'
index = index + 1
# finds if any of the images are on the screen and returns the filename
def findImagesOR():
result = multiImageSearch('OR')
print(str(result))
def main():
try:
findImages()
except KyeboardInterrupt:
print('Exiting Main Loop')
if __name__ == '__main__':
main()