자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
거린이집
8418
2년 전
거리니
118.216
6858
2년 전
거리니
118.216
9457
2년 전
ㅇㅇ
125.132
8965
2년 전
ㅇㅇ
112.218
6483
2년 전
백호줍줍
175.115
6964
2년 전
a가좋아
6680
2년 전
라징썬
106.250
7826
2년 전
ㅇㅇ
122.45
7604
2년 전
자유인
211.234
7766
2년 전
구지모시녀
6850
2년 전
도와줍쇼
218.50
7156
2년 전
오래된뉴비
9334
2년 전
황혼녁
220.118
7254
2년 전
ㅇㅇ
112.218
7495
2년 전
ㅇㅇ
59.1
10532
2년 전
스윗은붥
14.38
8924
2년 전
10203
121.165
9136
2년 전
ㅇㅇ
220.74
9538
2년 전
거리니
211.36
6179
2년 전
ㅇㅇ
112.218
6351
2년 전
123
121.164
11466
2년 전
오래된뉴비
17276
2년 전
슬프다
121.168
9377
2년 전
쌀먹올스타
1.214
6760
2년 전
달리아
8755
2년 전
하리진
121.179
8167
2년 전
하리진
106.101
9244
2년 전
00
220.74
8643
2년 전
ㅇㅇㅇㅇㅇ
118.41
9357
2년 전
거린이집
2년 전 조회 8418
거리니
비회원 118.216 2년 전 조회 6858
거리니
비회원 118.216 2년 전 조회 9457
ㅇㅇ
비회원 125.132 2년 전 조회 8965
ㅇㅇ
비회원 112.218 2년 전 조회 6483
백호줍줍
비회원 175.115 2년 전 조회 6964
a가좋아
2년 전 조회 6680
라징썬
비회원 106.250 2년 전 조회 7826
ㅇㅇ
비회원 122.45 2년 전 조회 7604
자유인
비회원 211.234 2년 전 조회 7766
구지모시녀
2년 전 조회 6850
도와줍쇼
비회원 218.50 2년 전 조회 7156
오래된뉴비
2년 전 조회 9334
황혼녁
비회원 220.118 2년 전 조회 7254
ㅇㅇ
비회원 112.218 2년 전 조회 7495
ㅇㅇ
비회원 59.1 2년 전 조회 10532
스윗은붥
비회원 14.38 2년 전 조회 8924
10203
비회원 121.165 2년 전 조회 9136
ㅇㅇ
비회원 220.74 2년 전 조회 9538
거리니
비회원 211.36 2년 전 조회 6179
ㅇㅇ
비회원 112.218 2년 전 조회 6351
123
비회원 121.164 2년 전 조회 11466
오래된뉴비
2년 전 조회 17276
슬프다
비회원 121.168 2년 전 조회 9377
쌀먹올스타
비회원 1.214 2년 전 조회 6760
달리아
2년 전 조회 8755
하리진
비회원 121.179 2년 전 조회 8167
하리진
비회원 106.101 2년 전 조회 9244
00
비회원 220.74 2년 전 조회 8643
ㅇㅇㅇㅇㅇ
비회원 118.41 2년 전 조회 9357