자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
헤헤벤져
5780
2년 전
슈슈슉
13921
2년 전
이끄요잇
4912
2년 전
uhs1005
5265
2년 전
동숟가락
4708
2년 전
멜로디레인
8328
2년 전
거린준비
4841
2년 전
perfume
14675
2년 전
전설
106.101
11234
2년 전
육의전이용자
222.96
5068
2년 전
사토
112.144
5220
2년 전
거린이일상
6965
2년 전
거붕
5473
2년 전
촌놈
6090
2년 전
미나리초무침
4843
2년 전
벵거룡
61.43
5249
2년 전
멍멍
125.243
6352
2년 전
뉴비에요
5748
2년 전
뉴비에요
4644
2년 전
거리니임
125.137
9144
2년 전
비람
5880
2년 전
방장
5812
2년 전
삼생매니저
1.241
6638
2년 전
미나리초무침
5239
2년 전
머해야함
61.78
7338
2년 전
잘양
1.215
5760
2년 전
다망해라
112.160
7552
2년 전
롤로랄라
222.98
7116
2년 전
팰팰
223.38
4718
2년 전
파드메
6097
2년 전
헤헤벤져
2년 전 조회 5780
슈슈슉
2년 전 조회 13921
이끄요잇
2년 전 조회 4912
uhs1005
2년 전 조회 5265
동숟가락
2년 전 조회 4708
멜로디레인
2년 전 조회 8328
거린준비
2년 전 조회 4841
perfume
2년 전 조회 14675
전설
비회원 106.101 2년 전 조회 11234
육의전이용자
비회원 222.96 2년 전 조회 5068
사토
비회원 112.144 2년 전 조회 5220
거린이일상
2년 전 조회 6965
거붕
2년 전 조회 5473
촌놈
2년 전 조회 6090
미나리초무침
2년 전 조회 4843
벵거룡
비회원 61.43 2년 전 조회 5249
멍멍
비회원 125.243 2년 전 조회 6352
뉴비에요
2년 전 조회 5748
뉴비에요
2년 전 조회 4644
거리니임
비회원 125.137 2년 전 조회 9144
비람
2년 전 조회 5880
방장
2년 전 조회 5812
삼생매니저
비회원 1.241 2년 전 조회 6638
미나리초무침
2년 전 조회 5239
머해야함
비회원 61.78 2년 전 조회 7338
잘양
비회원 1.215 2년 전 조회 5760
다망해라
비회원 112.160 2년 전 조회 7552
롤로랄라
비회원 222.98 2년 전 조회 7116
팰팰
비회원 223.38 2년 전 조회 4718
파드메
2년 전 조회 6097