자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
죽각
119.201
6729
3년 전
ㄷㄷㄷㄷㄷㄷㄷ
115.22
7445
3년 전
거갓난애기
125.190
5927
3년 전
복귀거리니
121.166
7063
3년 전
dkok2307
6962
3년 전
주작섭
119.64
7346
3년 전
6클라?
49.163
8227
3년 전
오래된뉴비
121.173
12169
3년 전
6클라?
49.163
8615
3년 전
암상인꾼난이형
6861
3년 전
아수라도둵
118.235
8199
3년 전
Hoonnn
7840
3년 전
chong13
7154
3년 전
거붕
7050
3년 전
댓글부탁합니다
39.7
6122
3년 전
미르
6395
3년 전
권좌의길
211.234
8181
3년 전
신구둵
121.150
8632
3년 전
백호닉네임
211.35
8446
3년 전
신구제보합니다
222.99
8920
3년 전
오이지오이
7855
3년 전
ㅇㅇ
175.115
8324
3년 전
일공사리틀꾸꾸
121.137
9504
3년 전
거상시작
7901
3년 전
프랭크버거
8475
3년 전
ㅁㅊ새끼네
211.222
8865
3년 전
거질이
223.39
8091
3년 전
거린이
121.181
7518
3년 전
거린이의걸인
106.101
8049
3년 전
ddw
110.13
6513
3년 전
죽각
비회원 119.201 3년 전 조회 6729
ㄷㄷㄷㄷㄷㄷㄷ
비회원 115.22 3년 전 조회 7445
거갓난애기
비회원 125.190 3년 전 조회 5927
복귀거리니
비회원 121.166 3년 전 조회 7063
dkok2307
3년 전 조회 6962
주작섭
비회원 119.64 3년 전 조회 7346
6클라?
비회원 49.163 3년 전 조회 8227
오래된뉴비
비회원 121.173 3년 전 조회 12169
6클라?
비회원 49.163 3년 전 조회 8615
암상인꾼난이형
3년 전 조회 6861
아수라도둵
비회원 118.235 3년 전 조회 8199
Hoonnn
3년 전 조회 7840
chong13
3년 전 조회 7154
거붕
3년 전 조회 7050
댓글부탁합니다
비회원 39.7 3년 전 조회 6122
미르
3년 전 조회 6395
권좌의길
비회원 211.234 3년 전 조회 8181
신구둵
비회원 121.150 3년 전 조회 8632
백호닉네임
비회원 211.35 3년 전 조회 8446
신구제보합니다
비회원 222.99 3년 전 조회 8920
오이지오이
3년 전 조회 7855
ㅇㅇ
비회원 175.115 3년 전 조회 8324
일공사리틀꾸꾸
비회원 121.137 3년 전 조회 9504
거상시작
3년 전 조회 7901
프랭크버거
3년 전 조회 8475
ㅁㅊ새끼네
비회원 211.222 3년 전 조회 8865
거질이
비회원 223.39 3년 전 조회 8091
거린이
비회원 121.181 3년 전 조회 7518
거린이의걸인
비회원 106.101 3년 전 조회 8049
ddw
비회원 110.13 3년 전 조회 6513