자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
1111
1.176
7792
3년 전
ㅇㅇㅇㅇ
121.154
8332
3년 전
투숙객
6673
3년 전
신구신기원좆댐
121.128
7816
3년 전
님비임비
7309
3년 전
짜잇
125.177
10502
3년 전
chong13
9443
3년 전
chong13
7766
3년 전
ㄱㄱ
106.101
7483
3년 전
ㅇㅇ
125.249
7179
3년 전
ㅇㅇ
125.249
7424
3년 전
신구가문제네
121.150
8533
3년 전
ㅅㅁ소액캐시삼
14.38
7123
3년 전
먹슬
210.99
7893
3년 전
으잉
121.154
8055
3년 전
ㅇㅇ
125.249
7124
3년 전
123
39.7
6822
3년 전
다망해라
112.160
10180
3년 전
쑥쑥이
223.62
7828
3년 전
방댕이
112.144
8958
3년 전
방댕이
112.144
23770
3년 전
암상인꾼난이형
6238
3년 전
멜로디레인
7147
3년 전
헤헤벤져
7183
3년 전
슈슈슉
16246
3년 전
이끄요잇
6312
3년 전
uhs1005
7069
3년 전
동숟가락
6062
3년 전
멜로디레인
10219
3년 전
거린준비
6257
3년 전
1111
비회원 1.176 3년 전 조회 7792
ㅇㅇㅇㅇ
비회원 121.154 3년 전 조회 8332
투숙객
3년 전 조회 6673
신구신기원좆댐
비회원 121.128 3년 전 조회 7816
님비임비
3년 전 조회 7309
짜잇
비회원 125.177 3년 전 조회 10502
chong13
3년 전 조회 9443
chong13
3년 전 조회 7766
ㄱㄱ
비회원 106.101 3년 전 조회 7483
ㅇㅇ
비회원 125.249 3년 전 조회 7179
ㅇㅇ
비회원 125.249 3년 전 조회 7424
신구가문제네
비회원 121.150 3년 전 조회 8533
ㅅㅁ소액캐시삼
비회원 14.38 3년 전 조회 7123
먹슬
비회원 210.99 3년 전 조회 7893
으잉
비회원 121.154 3년 전 조회 8055
ㅇㅇ
비회원 125.249 3년 전 조회 7124
123
비회원 39.7 3년 전 조회 6822
다망해라
비회원 112.160 3년 전 조회 10180
쑥쑥이
비회원 223.62 3년 전 조회 7828
방댕이
비회원 112.144 3년 전 조회 8958
방댕이
비회원 112.144 3년 전 조회 23770
암상인꾼난이형
3년 전 조회 6238
멜로디레인
3년 전 조회 7147
헤헤벤져
3년 전 조회 7183
슈슈슉
3년 전 조회 16246
이끄요잇
3년 전 조회 6312
uhs1005
3년 전 조회 7069
동숟가락
3년 전 조회 6062
멜로디레인
3년 전 조회 10219
거린준비
3년 전 조회 6257