자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
빈닥
7926
3년 전
recrec
7258
3년 전
밍킨
182.214
7267
3년 전
ㅇㅇ
112.218
8576
3년 전
kremund
7814
3년 전
아하이히유후
1.251
8249
3년 전
근짱
7673
3년 전
재밌네
221.163
8263
3년 전
거리니adnf
12181
3년 전
생계형쌀먹
58.234
12336
3년 전
오류때문에
211.49
9188
3년 전
ㅇㅇ
211.195
7689
3년 전
ㅇㅇ
118.235
9331
3년 전
ㅇㅇ
183.97
7167
3년 전
무서워ㅓㅓ
58.234
8007
3년 전
거리니광목
119.205
9007
3년 전
recrec
9038
3년 전
recrec
6716
3년 전
영웅서기
9240
3년 전
ㅋㅋㅋ
122.45
7932
3년 전
대구의달
61.80
9255
3년 전
에휴
59.24
7138
3년 전
거붕
7016
3년 전
recrec
13176
3년 전
123456
175.119
9791
3년 전
증린이
118.38
9183
3년 전
시바따
9571
3년 전
별달우리
112.173
7002
3년 전
ㅇㅇ
211.195
8050
3년 전
hscook
8258
3년 전
빈닥
3년 전 조회 7926
recrec
3년 전 조회 7258
밍킨
비회원 182.214 3년 전 조회 7267
ㅇㅇ
비회원 112.218 3년 전 조회 8576
kremund
3년 전 조회 7814
아하이히유후
비회원 1.251 3년 전 조회 8249
근짱
3년 전 조회 7673
재밌네
비회원 221.163 3년 전 조회 8263
거리니adnf
3년 전 조회 12181
생계형쌀먹
비회원 58.234 3년 전 조회 12336
오류때문에
비회원 211.49 3년 전 조회 9188
ㅇㅇ
비회원 211.195 3년 전 조회 7689
ㅇㅇ
비회원 118.235 3년 전 조회 9331
ㅇㅇ
비회원 183.97 3년 전 조회 7167
무서워ㅓㅓ
비회원 58.234 3년 전 조회 8007
거리니광목
비회원 119.205 3년 전 조회 9007
recrec
3년 전 조회 9038
recrec
3년 전 조회 6716
영웅서기
3년 전 조회 9240
ㅋㅋㅋ
비회원 122.45 3년 전 조회 7932
대구의달
비회원 61.80 3년 전 조회 9255
에휴
비회원 59.24 3년 전 조회 7138
거붕
3년 전 조회 7016
recrec
3년 전 조회 13176
123456
비회원 175.119 3년 전 조회 9791
증린이
비회원 118.38 3년 전 조회 9183
시바따
3년 전 조회 9571
별달우리
비회원 112.173 3년 전 조회 7002
ㅇㅇ
비회원 211.195 3년 전 조회 8050
hscook
3년 전 조회 8258