자유게시판 - 거상 갤러리

ㅇㅇ

ㅇㅇ 비회원 125.249 3년 전 조회 7031

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
ㅇㅇ
125.249
7086
3년 전
ㅇㅇ
125.249
7342
3년 전
신구가문제네
121.150
8432
3년 전
ㅅㅁ소액캐시삼
14.38
7016
3년 전
먹슬
210.99
7764
3년 전
으잉
121.154
7968
3년 전
ㅇㅇ
125.249
7032
3년 전
123
39.7
6751
3년 전
다망해라
112.160
10086
3년 전
쑥쑥이
223.62
7747
3년 전
방댕이
112.144
8882
3년 전
방댕이
112.144
23627
3년 전
암상인꾼난이형
6180
3년 전
멜로디레인
7070
3년 전
헤헤벤져
7103
3년 전
슈슈슉
16128
3년 전
이끄요잇
6233
3년 전
uhs1005
6943
3년 전
동숟가락
5947
3년 전
멜로디레인
10115
3년 전
거린준비
6179
3년 전
perfume
17645
3년 전
전설
106.101
13273
3년 전
육의전이용자
222.96
6507
3년 전
사토
112.144
6538
3년 전
거린이일상
8664
3년 전
거붕
6799
3년 전
촌놈
7614
3년 전
미나리초무침
6038
3년 전
벵거룡
61.43
6911
3년 전
ㅇㅇ
비회원 125.249 3년 전 조회 7086
ㅇㅇ
비회원 125.249 3년 전 조회 7342
신구가문제네
비회원 121.150 3년 전 조회 8432
ㅅㅁ소액캐시삼
비회원 14.38 3년 전 조회 7016
먹슬
비회원 210.99 3년 전 조회 7764
으잉
비회원 121.154 3년 전 조회 7968
ㅇㅇ
비회원 125.249 3년 전 조회 7032
123
비회원 39.7 3년 전 조회 6751
다망해라
비회원 112.160 3년 전 조회 10086
쑥쑥이
비회원 223.62 3년 전 조회 7747
방댕이
비회원 112.144 3년 전 조회 8882
방댕이
비회원 112.144 3년 전 조회 23627
암상인꾼난이형
3년 전 조회 6180
멜로디레인
3년 전 조회 7070
헤헤벤져
3년 전 조회 7103
슈슈슉
3년 전 조회 16128
이끄요잇
3년 전 조회 6233
uhs1005
3년 전 조회 6943
동숟가락
3년 전 조회 5947
멜로디레인
3년 전 조회 10115
거린준비
3년 전 조회 6179
perfume
3년 전 조회 17645
전설
비회원 106.101 3년 전 조회 13273
육의전이용자
비회원 222.96 3년 전 조회 6507
사토
비회원 112.144 3년 전 조회 6538
거린이일상
3년 전 조회 8664
거붕
3년 전 조회 6799
촌놈
3년 전 조회 7614
미나리초무침
3년 전 조회 6038
벵거룡
비회원 61.43 3년 전 조회 6911