자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
먹슬
210.99
6160
2년 전
으잉
121.154
6393
2년 전
ㅇㅇ
125.249
5580
2년 전
123
39.7
5281
2년 전
다망해라
112.160
8476
2년 전
쑥쑥이
223.62
6260
2년 전
방댕이
112.144
7581
2년 전
방댕이
112.144
20392
2년 전
암상인꾼난이형
4849
2년 전
멜로디레인
5467
2년 전
헤헤벤져
5650
2년 전
슈슈슉
13344
2년 전
이끄요잇
4831
2년 전
uhs1005
5143
2년 전
동숟가락
4619
2년 전
멜로디레인
8172
2년 전
거린준비
4716
2년 전
perfume
14190
2년 전
전설
106.101
10945
2년 전
육의전이용자
222.96
4970
2년 전
사토
112.144
5102
2년 전
거린이일상
6773
2년 전
거붕
5295
2년 전
촌놈
5959
2년 전
미나리초무침
4736
2년 전
벵거룡
61.43
5108
2년 전
멍멍
125.243
6237
2년 전
뉴비에요
5633
2년 전
뉴비에요
4552
2년 전
거리니임
125.137
8960
2년 전
먹슬
비회원 210.99 2년 전 조회 6160
으잉
비회원 121.154 2년 전 조회 6393
ㅇㅇ
비회원 125.249 2년 전 조회 5580
123
비회원 39.7 2년 전 조회 5281
다망해라
비회원 112.160 2년 전 조회 8476
쑥쑥이
비회원 223.62 2년 전 조회 6260
방댕이
비회원 112.144 2년 전 조회 7581
방댕이
비회원 112.144 2년 전 조회 20392
암상인꾼난이형
2년 전 조회 4849
멜로디레인
2년 전 조회 5467
헤헤벤져
2년 전 조회 5650
슈슈슉
2년 전 조회 13344
이끄요잇
2년 전 조회 4831
uhs1005
2년 전 조회 5143
동숟가락
2년 전 조회 4619
멜로디레인
2년 전 조회 8172
거린준비
2년 전 조회 4716
perfume
2년 전 조회 14190
전설
비회원 106.101 2년 전 조회 10945
육의전이용자
비회원 222.96 2년 전 조회 4970
사토
비회원 112.144 2년 전 조회 5102
거린이일상
2년 전 조회 6773
거붕
2년 전 조회 5295
촌놈
2년 전 조회 5959
미나리초무침
2년 전 조회 4736
벵거룡
비회원 61.43 2년 전 조회 5108
멍멍
비회원 125.243 2년 전 조회 6237
뉴비에요
2년 전 조회 5633
뉴비에요
2년 전 조회 4552
거리니임
비회원 125.137 2년 전 조회 8960