자유게시판 - 거상 갤러리

ㅇㅇ

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

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
댓글이 아직 없네요. 첫 번째로 댓글을 남겨주세요!
신구유나이티드
222.237
6943
2년 전
최셍
6404
2년 전
지국맨
211.234
5932
2년 전
복귀거리니
61.43
8150
2년 전
ㅇㅂㅇ
61.43
7920
2년 전
현거래궁금증
112.168
6985
2년 전
속도
5750
2년 전
영웅서기
5138
2년 전
거린이
110.47
5764
2년 전
거리니
211.187
6749
2년 전
다문뉴비
112.187
6226
2년 전
빈닥
6202
2년 전
블랙리스트추가
27.35
5723
2년 전
조심
118.41
7273
2년 전
속도
6308
2년 전
난장이
11220
2년 전
난폭토끼
5577
2년 전
ㅈㅅㅊㅊ
124.59
7935
2년 전
chong13
6672
2년 전
거래
211.234
7719
2년 전
호구냥
10991
2년 전
아이온큐
6643
2년 전
망아지아빠
119.193
5240
2년 전
아이온큐
5517
2년 전
ID가중복이
121.141
5458
2년 전
현무썹거린이
59.19
5917
2년 전
도와주세용
1.254
5597
2년 전
아아아아
182.230
4687
2년 전
멜로디레인
5268
2년 전
chong13
5197
2년 전
신구유나이티드
비회원 222.237 2년 전 조회 6943
최셍
2년 전 조회 6404
지국맨
비회원 211.234 2년 전 조회 5932
복귀거리니
비회원 61.43 2년 전 조회 8150
ㅇㅂㅇ
비회원 61.43 2년 전 조회 7920
현거래궁금증
비회원 112.168 2년 전 조회 6985
속도
2년 전 조회 5750
영웅서기
2년 전 조회 5138
거린이
비회원 110.47 2년 전 조회 5764
거리니
비회원 211.187 2년 전 조회 6749
다문뉴비
비회원 112.187 2년 전 조회 6226
빈닥
2년 전 조회 6202
블랙리스트추가
비회원 27.35 2년 전 조회 5723
조심
비회원 118.41 2년 전 조회 7273
속도
2년 전 조회 6308
난장이
2년 전 조회 11220
난폭토끼
2년 전 조회 5577
ㅈㅅㅊㅊ
비회원 124.59 2년 전 조회 7935
chong13
2년 전 조회 6672
거래
비회원 211.234 2년 전 조회 7719
호구냥
2년 전 조회 10991
아이온큐
2년 전 조회 6643
망아지아빠
비회원 119.193 2년 전 조회 5240
아이온큐
2년 전 조회 5517
ID가중복이
비회원 121.141 2년 전 조회 5458
현무썹거린이
비회원 59.19 2년 전 조회 5917
도와주세용
비회원 1.254 2년 전 조회 5597
아아아아
비회원 182.230 2년 전 조회 4687
멜로디레인
2년 전 조회 5268
chong13
2년 전 조회 5197