자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
출둘근기
115.160
12
한 시간 전
GS 운양남
58.77
201
25일 전
신구치코리타
118.235
169
25일 전
니가해봐라
211.215
141
한 달 전
계복순이
49.165
188
한 달 전
제주거리니
156
한 달 전
ㅇㅇ
210.57
413
한 달 전
ㅇㅇ
210.57
271
한 달 전
ㅇㅇ
210.57
379
한 달 전
금옥례
59.26
299
한 달 전
아짜이뽀
124.49
324
한 달 전
복귀유저
14.7
381
한 달 전
프지생
116.43
297
한 달 전
ㅇㅇㅇㅇ
14.63
366
한 달 전
장화보이
485
한 달 전
ㅁㅈ
118.130
419
한 달 전
부탁드립니다
175.213
526
한 달 전
ㅇㅇ
121.101
314
한 달 전
dddd
119.17
588
한 달 전
zsat
977
2달 전
랑검
61.81
1146
2달 전
ㅇㅇㅇ
116.43
606
2달 전
버벌진트
106.102
343
2달 전
소시민
1037
2달 전
각다문갖고싶어
211.193
734
2달 전
명언제조기
1.255
371
2달 전
청룡서버
121.151
233
2달 전
뽀뽀맨
220.65
1138
2달 전
하나
125.184
624
2달 전
라고할뻔
124.28
720
2달 전
출둘근기
비회원 115.160 한 시간 전 조회 12
GS 운양남
비회원 58.77 25일 전 조회 201
신구치코리타
비회원 118.235 25일 전 조회 169
니가해봐라
비회원 211.215 한 달 전 조회 141
계복순이
비회원 49.165 한 달 전 조회 188
제주거리니
한 달 전 조회 156
ㅇㅇ
비회원 210.57 한 달 전 조회 413
ㅇㅇ
비회원 210.57 한 달 전 조회 271
ㅇㅇ
비회원 210.57 한 달 전 조회 379
금옥례
비회원 59.26 한 달 전 조회 299
아짜이뽀
비회원 124.49 한 달 전 조회 324
복귀유저
비회원 14.7 한 달 전 조회 381
프지생
비회원 116.43 한 달 전 조회 297
ㅇㅇㅇㅇ
비회원 14.63 한 달 전 조회 366
장화보이
한 달 전 조회 485
ㅁㅈ
비회원 118.130 한 달 전 조회 419
부탁드립니다
비회원 175.213 한 달 전 조회 526
ㅇㅇ
비회원 121.101 한 달 전 조회 314
dddd
비회원 119.17 한 달 전 조회 588
zsat
2달 전 조회 977
랑검
비회원 61.81 2달 전 조회 1146
ㅇㅇㅇ
비회원 116.43 2달 전 조회 606
버벌진트
비회원 106.102 2달 전 조회 343
소시민
2달 전 조회 1037
각다문갖고싶어
비회원 211.193 2달 전 조회 734
명언제조기
비회원 1.255 2달 전 조회 371
청룡서버
비회원 121.151 2달 전 조회 233
뽀뽀맨
비회원 220.65 2달 전 조회 1138
하나
비회원 125.184 2달 전 조회 624
라고할뻔
비회원 124.28 2달 전 조회 720