자유게시판 - 거상 갤러리

ㅇㅇ

ㅇㅇ 비회원 125.249 2년 전 조회 5373

import pyautogui as pag
import os
import time
import keyboard as key
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *

from gersangAlarm.gersang_alarm_UI import Ui_MainWindow
image_list_1 = []

class check_image_fuction(QMainWindow,Ui_MainWindow):
   def __init__(self):
       super().__init__()
       self.setupUi(self)
       self.worker_a = worker_a()
       self.show()

   def start(self):

       self.worker_a.start()
       pass

# Get list of all files in current directory
path1 = "./icon1/"
directory1 = os.listdir(path1)


# Find files that end with .png or .jpg and add to image_list
for file in directory1:
   if file.endswith('.png') or file.endswith('.jpg'):
       image_list_1.append(file)

# Thread A
class worker_a(QThread):
   def run(self):
       try:
           while True:
               # Loop through list to find all the images
               for image in image_list_1:
                   var = pag.locateAllOnScreen(path1 + image, confidence=0.98)
                   var = list(var)
                   time.sleep(0.5)
                   if len(var) != 0:
                       key.press('alt')
                       time.sleep(0.05)
                       key.press('1')
                       time.sleep(0.05)
                       key.release('1')
                       time.sleep(0.05)
                       key.release('alt')
               del var
               time.sleep(0.5)
       except KeyboardInterrupt:
           print('\n')


app = QApplication([])
main_dialog = check_image_fuction() 
QApplication.processEvents()
app.exit(app.exec_())

댓글 0
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
님비임비
5407
2년 전
짜잇
125.177
7678
2년 전
chong13
7497
2년 전
chong13
5813
2년 전
ㄱㄱ
106.101
5594
2년 전
ㅇㅇ
125.249
5344
2년 전
ㅇㅇ
125.249
5563
2년 전
신구가문제네
121.150
6665
2년 전
ㅅㅁ소액캐시삼
14.38
5233
2년 전
먹슬
210.99
5879
2년 전
으잉
121.154
6163
2년 전
ㅇㅇ
125.249
5374
2년 전
123
39.7
5070
2년 전
다망해라
112.160
8113
2년 전
쑥쑥이
223.62
6061
2년 전
방댕이
112.144
7393
2년 전
방댕이
112.144
18867
2년 전
암상인꾼난이형
4636
2년 전
멜로디레인
5234
2년 전
헤헤벤져
5422
2년 전
슈슈슉
12229
2년 전
이끄요잇
4606
2년 전
uhs1005
4915
2년 전
동숟가락
4456
2년 전
멜로디레인
7788
2년 전
거린준비
4509
2년 전
perfume
13064
2년 전
전설
106.101
10365
2년 전
육의전이용자
222.96
4791
2년 전
사토
112.144
4924
2년 전
님비임비
2년 전 조회 5407
짜잇
비회원 125.177 2년 전 조회 7678
chong13
2년 전 조회 7497
chong13
2년 전 조회 5813
ㄱㄱ
비회원 106.101 2년 전 조회 5594
ㅇㅇ
비회원 125.249 2년 전 조회 5344
ㅇㅇ
비회원 125.249 2년 전 조회 5563
신구가문제네
비회원 121.150 2년 전 조회 6665
ㅅㅁ소액캐시삼
비회원 14.38 2년 전 조회 5233
먹슬
비회원 210.99 2년 전 조회 5879
으잉
비회원 121.154 2년 전 조회 6163
ㅇㅇ
비회원 125.249 2년 전 조회 5374
123
비회원 39.7 2년 전 조회 5070
다망해라
비회원 112.160 2년 전 조회 8113
쑥쑥이
비회원 223.62 2년 전 조회 6061
방댕이
비회원 112.144 2년 전 조회 7393
방댕이
비회원 112.144 2년 전 조회 18867
암상인꾼난이형
2년 전 조회 4636
멜로디레인
2년 전 조회 5234
헤헤벤져
2년 전 조회 5422
슈슈슉
2년 전 조회 12229
이끄요잇
2년 전 조회 4606
uhs1005
2년 전 조회 4915
동숟가락
2년 전 조회 4456
멜로디레인
2년 전 조회 7788
거린준비
2년 전 조회 4509
perfume
2년 전 조회 13064
전설
비회원 106.101 2년 전 조회 10365
육의전이용자
비회원 222.96 2년 전 조회 4791
사토
비회원 112.144 2년 전 조회 4924