자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
chong13
7975
3년 전
포트란
1.245
7859
3년 전
복귀한 거린이
7140
3년 전
후덜덜하네
121.153
8232
3년 전
코해엥
220.126
8671
3년 전
1111
1.176
8230
3년 전
ㅇㅇㅇㅇ
121.154
8702
3년 전
투숙객
7101
3년 전
신구신기원좆댐
121.128
8186
3년 전
님비임비
7749
3년 전
짜잇
125.177
10980
3년 전
chong13
9899
3년 전
chong13
8239
3년 전
ㄱㄱ
106.101
7925
3년 전
ㅇㅇ
125.249
7668
3년 전
ㅇㅇ
125.249
7738
3년 전
신구가문제네
121.150
9016
3년 전
ㅅㅁ소액캐시삼
14.38
7645
3년 전
먹슬
210.99
8348
3년 전
으잉
121.154
8428
3년 전
ㅇㅇ
125.249
7524
3년 전
123
39.7
7181
3년 전
다망해라
112.160
10581
3년 전
쑥쑥이
223.62
8155
3년 전
방댕이
112.144
9289
3년 전
방댕이
112.144
24282
3년 전
암상인꾼난이형
6590
3년 전
멜로디레인
7660
3년 전
헤헤벤져
7657
3년 전
슈슈슉
16670
3년 전
chong13
3년 전 조회 7975
포트란
비회원 1.245 3년 전 조회 7859
복귀한 거린이
3년 전 조회 7140
후덜덜하네
비회원 121.153 3년 전 조회 8232
코해엥
비회원 220.126 3년 전 조회 8671
1111
비회원 1.176 3년 전 조회 8230
ㅇㅇㅇㅇ
비회원 121.154 3년 전 조회 8702
투숙객
3년 전 조회 7101
신구신기원좆댐
비회원 121.128 3년 전 조회 8186
님비임비
3년 전 조회 7749
짜잇
비회원 125.177 3년 전 조회 10980
chong13
3년 전 조회 9899
chong13
3년 전 조회 8239
ㄱㄱ
비회원 106.101 3년 전 조회 7925
ㅇㅇ
비회원 125.249 3년 전 조회 7668
ㅇㅇ
비회원 125.249 3년 전 조회 7738
신구가문제네
비회원 121.150 3년 전 조회 9016
ㅅㅁ소액캐시삼
비회원 14.38 3년 전 조회 7645
먹슬
비회원 210.99 3년 전 조회 8348
으잉
비회원 121.154 3년 전 조회 8428
ㅇㅇ
비회원 125.249 3년 전 조회 7524
123
비회원 39.7 3년 전 조회 7181
다망해라
비회원 112.160 3년 전 조회 10581
쑥쑥이
비회원 223.62 3년 전 조회 8155
방댕이
비회원 112.144 3년 전 조회 9289
방댕이
비회원 112.144 3년 전 조회 24282
암상인꾼난이형
3년 전 조회 6590
멜로디레인
3년 전 조회 7660
헤헤벤져
3년 전 조회 7657
슈슈슉
3년 전 조회 16670