bu kod tek tekrar için yapıldı ancaksınırsız tekrar eklemeye calısıyorum esc tuşu ile başlayıp kapanacak şekilde bir tülü olmuyor
not:kodu nasıl ekleyecegimi bilemedigim icin spolier kısmına ekledim 1500 satır lütfen sövmeyin daha cok yeniyim

import cv2
import numpy as np
import mss
import os
import ctypes
import time
from interception import *
import keyboard
import threading
# Ekran boyutlarını al
def get_screen_size():
user32 = ctypes.windll.user32
screen_width = user32.GetSystemMetrics(0)
screen_height = user32.GetSystemMetrics(1)
return screen_width, screen_height
screen_width, screen_height = get_screen_size()
# Ekran ve mouse kontrolü için context oluştur
context = interception()
class MouseDriver:
def __init__(self):
self.driver = context
self.mouse = self.get_mouse_driver()
def get_mouse_driver(self):
for i in range(MAX_DEVICES):
if interception.is_mouse(i):
return i
return None
def move_and_click(self, x, y, button='left'):
if self.mouse is None:
print("Mouse device not found.")
return
x1 = int(x * 65535 / screen_width)
y1 = int(y * 65535 / screen_height)
button_down = interception_mouse_state.INTERCEPTION_MOUSE_LEFT_B UTTON_DOWN.value if button == 'left' else interception_mouse_state.INTERCEPTION_MOUSE_RIGHT_ BUTTON_DOWN.value
button_up = interception_mouse_state.INTERCEPTION_MOUSE_LEFT_B UTTON_UP.value if button == 'left' else interception_mouse_state.INTERCEPTION_MOUSE_RIGHT_ BUTTON_UP.value
# Hareketi yap
mstroke = mouse_stroke(
0,
interception_mouse_flag.INTERCEPTION_MOUSE_MOVE_AB SOLUTE.value, 0, x1, y1, 0
)
context.send(self.mouse, mstroke)
# Tıklama işlemi
mstroke.state = button_down
context.send(self.mouse, mstroke)
time.sleep(0.05)
mstroke.state = button_up
context.send(self.mouse, mstroke)
print(f"{button.capitalize()} tıklama yapıldı: ({x}, {y})")
def find_image(image_path, threshold=0.8):
if not os.path.exists(image_path):
print(f"Görüntü dosyası mevcut değil: {image_path}")
return None, None
template = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
if template is None:
print(f"Görüntü dosyası açılamadı: {image_path}")
return None, None
with mss.mss() as sct:
monitor = {"top": 0, "left": 0, "width": screen_width, "height": screen_height}
screen = np.array(sct.grab(monitor))
screen_gray = cv2.cvtColor(screen, cv2.COLOR_BGR2GRAY)
result = cv2.matchTemplate(screen_gray, template, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)
if max_val >= threshold:
return max_loc, template.shape[::-1]
else:
return None, None
def click_start_and_stop(mouse_driver, image_path_start, image_path_stop):
# start.png arama işlemi
while True:
coord_start, template_size_start = find_image(image_path_start)
if coord_start is not None:
center_x_start = coord_start[0] + template_size_start[0] // 2
center_y_start = coord_start[1] + template_size_start[1] // 2
mouse_driver.move_and_click(center_x_start, center_y_start, button='left')
print("start.png bulundu, sol tıklama yapıldı.")
break
else:
print("start.png bulunamadı, tekrar aranıyor...")
time.sleep(0.25)
# stop.png arama işlemi
while True:
coord_stop, template_size_stop = find_image(image_path_stop)
if coord_stop is not None:
center_x_stop = coord_stop[0] + template_size_stop[0] // 2
center_y_stop = coord_stop[1] + template_size_stop[1] // 2
mouse_driver.move_and_click(center_x_stop, center_y_stop, button='left')
print("stop.png bulundu, sol tıklama yapıldı.")
break
else:
print("stop.png bulunamadı, tekrar aranıyor...")
def perform_actions():
print("Başlamak için ESC tuşuna basın...")
while not keyboard.is_pressed('esc'):
time.sleep(0.1)
print("Başlatılıyor...")
time.sleep(1)
mouse_driver = MouseDriver()
# Resim yolları
image_path_narki = r'D:narki botkecoon botresimlernarki.png'
image_path_narki_acma = r'D:narki botkecoon botresimlernarki_acma.png'
image_path_referans = r'D:narki botkecoon botresimlerreferans.png'
image_path_start = r'D:narki botkecoon botresimlerstart.png'
image_path_stop = r'D:narki botkecoon botresimlerstop.png'
image_path_info = r'D:narki botkecoon botresimlerinfo.png' # info.png yolunu belirtin
image_path_clan = r'D:narki botkecoon botresimlerclan.png' # clan.png yolunu belirtin
image_path_clan2 = r'D:narki botkecoon botresimlerclan2.png' # clan2.png yolunu belirtin
image_path_narkix = r'D:narki botkecoon botresimlernarkix.png'
image_path_confn = r'D:narki botkecoon botresimlerconfn.png'
image_path_cop1 = r'D:narki botkecoon botresimlerx1.png'
image_path_cop2 = r'D:narki botkecoon botresimlerx2.png'
image_path_envanter = r'D:narki botkecoon botresimlerenvanter.png'
image_path_sil = r'D:narki botkecoon botresimlersil.png'
# referans.png arama işlemi her işlem öncesinde
def check_and_click_referans():
coord_ref, template_size_ref = find_image(image_path_referans)
if coord_ref is not None:
center_x_ref = coord_ref[0] + template_size_ref[0] // 2
center_y_ref = coord_ref[1] + template_size_ref[1] // 2
return center_x_ref, center_y_ref
else:
print("referans.png bulunamadı, tekrar aranıyor...")
return None, None
# İlk referans kontrolü ve tıklama işlemi (narki.png)
while True:
coord_narki, template_size_narki = find_image(image_path_narki)
if coord_narki is not None:
center_x_narki = coord_narki[0] + template_size_narki[0] // 2
center_y_narki = coord_narki[1] + template_size_narki[1] // 2
for i in range(3):
mouse_driver.move_and_click(center_x_narki, center_y_narki + 150, button='right')
print(f"{i + 1}. sağ tıklama yapıldı.")
time.sleep(0.3)
break # narki.png bulundu, aramayı durdur
else:
print("narki.png bulunamadı, tekrar aranıyor...")
# narki_acma.png arama işlemi
while True:
coord_narki_acma, template_size_narki_acma = find_image(image_path_narki_acma)
if coord_narki_acma is not None:
center_x_narki_acma = coord_narki_acma[0] + template_size_narki_acma[0] // 2
center_y_narki_acma = coord_narki_acma[1] + template_size_narki_acma[1] // 2
mouse_driver.move_and_click(center_x_narki_acma, center_y_narki_acma, button='left')
print("narki_acma.png bulundu, sol tıklama yapıldı.")
break # narki_acma.png bulundu, aramayı durdur
else:
print("narki_acma.png bulunamadı, tekrar aranıyor...")
# İlk referans kontrolü ve tıklama işlemi (referans.png)
while True:
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# İlk tıklama (-160, +380)
tıklama_x_1 = center_x_ref - 160
tıklama_y_1 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_1, tıklama_y_1, button='right')
print(f"referans.png bulundu, ilk sağ tıklama yapıldı: ({tıklama_x_1}, {tıklama_y_1})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# İkinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# İkinci tıklama (-100, +380)
tıklama_x_2 = center_x_ref - 100
tıklama_y_2 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_2, tıklama_y_2, button='right')
print(f"referans.png için ikinci sağ tıklama yapıldı: ({tıklama_x_2}, {tıklama_y_2})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Üçüncü referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Üçüncü tıklama (-40, +380)
tıklama_x_3 = center_x_ref - 40
tıklama_y_3 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_3, tıklama_y_3, button='right')
print(f"referans.png için üçüncü sağ tıklama yapıldı: ({tıklama_x_3}, {tıklama_y_3})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Dördüncü referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Dördüncü tıklama (+20, +380)
tıklama_x_4 = center_x_ref + 20
tıklama_y_4 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_4, tıklama_y_4, button='right')
print(f"referans.png için dördüncü sağ tıklama yapıldı: ({tıklama_x_4}, {tıklama_y_4})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Beşinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Beşinci tıklama (+70, +380)
tıklama_x_5 = center_x_ref + 70
tıklama_y_5 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_5, tıklama_y_5, button='right')
print(f"referans.png için beşinci sağ tıklama yapıldı: ({tıklama_x_5}, {tıklama_y_5})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Altıncı referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Altıncı tıklama (+120, +380)
tıklama_x_6 = center_x_ref + 120
tıklama_y_6 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_6, tıklama_y_6, button='right')
print(f"referans.png için altıncı sağ tıklama yapıldı: ({tıklama_x_6}, {tıklama_y_6})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Yedinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Yedinci tıklama (+170, +380)
tıklama_x_7 = center_x_ref + 170
tıklama_y_7 = center_y_ref + 380
mouse_driver.move_and_click(tıklama_x_7, tıklama_y_7, button='right')
print(f"referans.png için yedinci sağ tıklama yapıldı: ({tıklama_x_7}, {tıklama_y_7})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Sekizinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Sekizinci tıklama (-160, +430)
tıklama_x_8 = center_x_ref - 160
tıklama_y_8 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_8, tıklama_y_8, button='right')
print(f"referans.png için sekizinci sağ tıklama yapıldı: ({tıklama_x_8}, {tıklama_y_8})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Dokuzuncu referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Dokuzuncu tıklama (-100, +430)
tıklama_x_9 = center_x_ref - 100
tıklama_y_9 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_9, tıklama_y_9, button='right')
print(f"referans.png için dokuzuncu sağ tıklama yapıldı: ({tıklama_x_9}, {tıklama_y_9})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Onuncu referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Onuncu tıklama (-40, +430)
tıklama_x_10 = center_x_ref - 40
tıklama_y_10 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_10, tıklama_y_10, button='right')
print(f"referans.png için onuncu sağ tıklama yapıldı: ({tıklama_x_10}, {tıklama_y_10})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Onbirinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Onbirinci tıklama (+20, +430)
tıklama_x_11 = center_x_ref + 20
tıklama_y_11 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_11, tıklama_y_11, button='right')
print(f"referans.png için onbirinci sağ tıklama yapıldı: ({tıklama_x_11}, {tıklama_y_11})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Onikinci referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Onikinci tıklama (+70, +430)
tıklama_x_12 = center_x_ref + 70
tıklama_y_12 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_12, tıklama_y_12, button='right')
print(f"referans.png için onikinci sağ tıklama yapıldı: ({tıklama_x_12}, {tıklama_y_12})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Onüçüncü referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Onüçüncü tıklama (+120, +430)
tıklama_x_13 = center_x_ref + 120
tıklama_y_13 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_13, tıklama_y_13, button='right')
print(f"referans.png için onüçüncü sağ tıklama yapıldı: ({tıklama_x_13}, {tıklama_y_13})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# Ondördüncü referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref + 170
tıklama_y_14 = center_y_ref + 430
mouse_driver.move_and_click(tıklama_x_14, tıklama_y_14, button='right')
print(f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver, image_path_start, image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# onbeş referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref - 160
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver, image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.2 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref - 100
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.3 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref - 40
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.4 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref + 20
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(
tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.5 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref + 60
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(
tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.6 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref + 110
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(
tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(
mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# 3.2 referans kontrolü ve tıklama işlemi
center_x_ref, center_y_ref = check_and_click_referans()
if center_x_ref is not None and center_y_ref is not None:
# Ondördüncü tıklama (+170, +430)
tıklama_x_14 = center_x_ref + 160
tıklama_y_14 = center_y_ref + 480
mouse_driver.move_and_click(
tıklama_x_14,
tıklama_y_14,
button='right')
print(
f"referans.png için ondördüncü sağ tıklama yapıldı: ({tıklama_x_14}, {tıklama_y_14})")
click_start_and_stop(
mouse_driver,
image_path_start,
image_path_stop)
# 600 ms bekle
time.sleep(0.6)
# info.png arama işlemi
while True:
coord_info, template_size_info = find_image(
image_path_info)
if coord_info is not None:
center_x_info =
coord_info[0] +
template_size_info[
0] // 2
center_y_info =
coord_info[1] +
template_size_info[
1] // 2
# Mouse imlecini info.png üzerinde hareket ettir
mouse_driver.move_and_click(
center_x_info,
center_y_info,
button='none')
print(
f"info.png bulundu, üzerine gidildi: ({center_x_info}, {center_y_info})")
# Bekleme süresi (örneğin 1 saniye)
time.sleep(0.3)
# Sol tıklama işlemi
mouse_driver.move_and_click(
center_x_info,
center_y_info,
button='left')
print(
f"info.png üzerine gelindi ve sol tıklama yapıldı: ({center_x_info}, {center_y_info})")
break # info.png bulundu, işlemi durdur
else:
print(
"info.png bulunamadı, tekrar aranıyor...")
time.sleep(0.5)
time.sleep(0.4)
# clan.png arama işlemi
while True:
coord_clan, template_size_clan = find_image(
image_path_clan)
if coord_clan is not None:
center_x_clan =
coord_clan[0] +
template_size_clan[
0] // 2
center_y_clan =
coord_clan[1] +
template_size_clan[
1] // 2
# Mouse imlecini clan.png üzerinde hareket ettir
mouse_driver.move_and_click(
center_x_clan,
center_y_clan,
button='none')
print(
f"clan.png bulundu, üzerine gidildi: ({center_x_clan}, {center_y_clan})")
# Bekleme süresi (örneğin 1 saniye)
time.sleep(0.3)
# Sol tıklama işlemi
mouse_driver.move_and_click(
center_x_clan,
center_y_clan,
button='left')
print(
f"clan.png üzerine gelindi ve sol tıklama yapıldı: ({center_x_clan}, {center_y_clan})")
break # clan.png bulundu, işlemi durdur
else:
print(
"clan.png bulunamadı, tekrar aranıyor...")
time.sleep(0.5)
time.sleep(0.4)
# clan2.png arama işlemi
while True:
coord_clan2, template_size_clan2 = find_image(
image_path_clan2)
if coord_clan2 is not None:
center_x_clan2 =
coord_clan2[0] +
template_size_clan2[
0] // 2
center_y_clan2 =
coord_clan2[1] +
template_size_clan2[
1] // 2
# Mouse imlecini clan2.png üzerinde hareket ettir
mouse_driver.move_and_click(
center_x_clan2,
center_y_clan2,
button='none')
print(
f"clan2.png bulundu, üzerine gidildi: ({center_x_clan2}, {center_y_clan2})")
# Bekleme süresi (örneğin 1 saniye)
time.sleep(0.3)
# Sol tıklama işlemi
mouse_driver.move_and_click(
center_x_clan2,
center_y_clan2,
button='left')
print(
f"clan2.png üzerine gelindi ve sol tıklama yapıldı: ({center_x_clan2}, {center_y_clan2})")
break # clan2.png bulundu, işlemi durdur
else:
print(
"clan2.png bulunamadı, tekrar aranıyor...")
time.sleep(0.5)
time.sleep(0.4)
while True:
coord_narkix, template_size_narkix = find_image(
image_path_narkix)
if coord_narkix is not None:
# narkix.png'nin bulunduğu koordinata (280, 15) ekleyerek tıklama işlemi yapılır
click_x =
coord_narkix[
0] + 280
click_y =
coord_narkix[1] + 15
mouse_driver.move_and_click(
click_x,
click_y,
button='none') # Önce mouse imlecini getir
print(
f"narkix.png bulundu, mouse ({click_x}, {click_y}) noktasına götürüldü.")
time.sleep(
0.1) # 100 ms bekle
mouse_driver.move_and_click(
click_x,
click_y,
button='left') # 100 ms sonra sol tıklama işlemi yap
print(
f"narkix.png bulundu ve ({click_x}, {click_y}) noktasına sol tıklama yapıldı.")
time.sleep(
0.1) # 100 ms bekle
# başlangıc banka boşalt narkix.png işlemi tamamlandıktan sonra (1560, 479) koordinatına sağ tıklama yapılacak
# -------- 1.1 slot --------
mouse_driver.move_and_click(
1560, 479,
button='right')
print(
"1560, 479 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn, template_size_confn = find_image(
image_path_confn)
if coord_confn is not None:
center_x_confn =
coord_confn[0] +
template_size_confn[
0] // 2
center_y_confn =
coord_confn[1] +
template_size_confn[
1] // 2
mouse_driver.move_and_click(
center_x_confn,
center_y_confn,
button='left')
print(
f"confn.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.2 slot --------
mouse_driver.move_and_click(
1611, 488,
button='right')
print(
"1611, 488 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.3 slot --------
mouse_driver.move_and_click(
1660, 480,
button='right')
print(
"1660, 480 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.4 slot --------
mouse_driver.move_and_click(
1709, 482,
button='right')
print(
"1709, 482 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.5 slot --------
mouse_driver.move_and_click(
1758, 482,
button='right')
print(
"1758, 482 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.6 slot --------
mouse_driver.move_and_click(
1809, 482,
button='right')
print(
"1809, 482 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 1.7 slot --------
mouse_driver.move_and_click(
1857, 482,
button='right')
print(
"1857, 482 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.1 slot --------
mouse_driver.move_and_click(
1559, 532,
button='right')
print(
"1559, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.2 slot --------
mouse_driver.move_and_click(
1611, 532,
button='right')
print(
"1611, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.3 slot --------
mouse_driver.move_and_click(
1657, 532,
button='right')
print(
"1657, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.4 slot --------
mouse_driver.move_and_click(
1708, 532,
button='right')
print(
"1708, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.5 slot --------
mouse_driver.move_and_click(
1759, 532,
button='right')
print(
"1759, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.6 slot --------
mouse_driver.move_and_click(
1810, 532,
button='right')
print(
"1810, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 2.7 slot --------
mouse_driver.move_and_click(
1862, 532,
button='right')
print(
"1862, 532 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.1 slot --------
mouse_driver.move_and_click(
1559, 581,
button='right')
print(
"1559, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.2 slot --------
mouse_driver.move_and_click(
1611, 581,
button='right')
print(
"1611, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.3 slot --------
mouse_driver.move_and_click(
1657, 581,
button='right')
print(
"1657, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.4 slot --------
mouse_driver.move_and_click(
1708, 581,
button='right')
print(
"1708, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.5 slot --------
mouse_driver.move_and_click(
1759, 581,
button='right')
print(
"1759, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.6 slot --------
mouse_driver.move_and_click(
1810, 581,
button='right')
print(
"1810, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 3.7 slot --------
mouse_driver.move_and_click(
1862, 581,
button='right')
print(
"1862, 581 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 4.1 slot --------
mouse_driver.move_and_click(
1559, 634,
button='right')
print(
"1559, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 4.2 slot --------
mouse_driver.move_and_click(
1611, 634,
button='right')
print(
"1611, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 4.3 slot --------
mouse_driver.move_and_click(
1657, 634,
button='right')
print(
"1657, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 4.4 slot --------
mouse_driver.move_and_click(
1708, 634,
button='right')
print(
"1708, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# -------- 4.5 slot --------
mouse_driver.move_and_click(
1759, 634,
button='right')
print(
"1759, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.08)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.08)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.08)
# -------- 4.6 slot --------
mouse_driver.move_and_click(
1810, 634,
button='right')
print(
"1810, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.08)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.08)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.08)
# -------- 4.7 slot --------
mouse_driver.move_and_click(
1862, 634,
button='right')
print(
"1862, 634 koordinatına sağ tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.09)
coord_confn_new, template_size_confn_new = find_image(
image_path_confn)
if coord_confn_new is not None:
center_x_confn_new =
coord_confn_new[
0] +
template_size_confn_new[
0] // 2
center_y_confn_new =
coord_confn_new[
1] +
template_size_confn_new[
1] // 2
mouse_driver.move_and_click(
center_x_confn_new,
center_y_confn_new,
button='left')
print(
f"confn_new.png üzerine gelindi ve sol tıklama yapıldı.")
# 50 ms bekleme
time.sleep(0.05)
else:
print(
"confn_new.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# Tüm işlemler tamamlandıktan sonra envanter.png'yi bul ve tıkla
coord_envanter, template_size_envanter = find_image(
r"D:narki botkecoon botresimlerenvanter.png") # envanter.png dosya yolunu belirtin
if coord_envanter is not None:
center_x_envanter =
coord_envanter[
0] +
template_size_envanter[
0] // 2
center_y_envanter =
coord_envanter[
1] +
template_size_envanter[
1] // 2
# Mouse'u envanter.png'nin ortasına götür
mouse_driver.move_and_click(
center_x_envanter,
center_y_envanter,
button='none')
print(
f"envanter.png bulundu, mouse ({center_x_envanter}, {center_y_envanter}) noktasına götürüldü.")
# Görsellerin yolları
image_path_envanter = r'D:narki botkecoon botresimlerenvanter.png'
image_path_x1 = r'D:narki botkecoon botresimlerx1.png'
image_path_x2 = r'D:narki botkecoon botresimlerx2.png'
image_path_sil = r'D:narki botkecoon botresimlersil.png'
image_path_clan2 = r'D:narki botkecoon botresimlerclan2.png'
# 30 ms bekle
time.sleep(0.03)
# Sol tıklama işlemi
if coord_envanter is not None:
mouse_driver.move_and_click(
center_x_envanter,
center_y_envanter,
button='left')
print(
f"envanter.png üzerine gelindi ve sol tıklama yapıldı.")
else:
print(
"envanter.png bulunamadı, işlemlere devam ediliyor...")
# 500 ms bekleme
time.sleep(0.5)
# x1.png ve x2.png'yi ara, bulduktan sonra sürükle ve sil.png'ye tıkla
def drag_and_drop_garbage(
image_path,
target_x=1870,
target_y=442):
while True:
coord_garbage, template_size_garbage = find_image(
image_path)
if coord_garbage is not None:
center_x_garbage =
coord_garbage[
0] +
template_size_garbage[
0] // 2
center_y_garbage =
coord_garbage[
1] +
template_size_garbage[
1] // 2
# Mouse'u x1.png veya x2.png'nin üzerine getir
mouse_driver.move_and_click(
center_x_garbage,
center_y_garbage,
button='none')
print(
f"{image_path} bulundu, mouse ({center_x_garbage}, {center_y_garbage}) noktasına getirildi.")
# 50 ms bekle
time.sleep(
0.05)
# Sürükleme işlemi (x1.png veya x2.png'yi x: 1870, y: 442 konumuna sürükle)
mouse_driver.move_and_click(
center_x_garbage,
center_y_garbage,
button='left') # Sol tıklama ile tut
mouse_driver.move_and_click(
target_x,
target_y,
button='left') # Hedefe sürükle ve bırak
print(
f"{image_path} {target_x}, {target_y} koordinatlarına sürüklendi.")
# sil.png'yi bul ve tıkla
coord_sil, template_size_sil = find_image(
image_path_sil)
if coord_sil is not None:
center_x_sil =
coord_sil[
0] +
template_size_sil[
0] // 2
center_y_sil =
coord_sil[
1] +
template_size_sil[
1] // 2
# Mouse'u sil.png'nin ortasına getir
mouse_driver.move_and_click(
center_x_sil,
center_y_sil,
button='none')
print(
f"sil.png bulundu, mouse ({center_x_sil}, {center_y_sil}) noktasına getirildi.")
# 50 ms bekle
time.sleep(
0.05)
# Sol tıklama işlemi
mouse_driver.move_and_click(
center_x_sil,
center_y_sil,
button='left')
print(
f"sil.png üzerine sol tıklama yapıldı.")
else:
print(
"sil.png bulunamadı.")
else:
print(
f"{image_path} bulunamadı, diğer işlemlere geçiliyor.")
break # x1.png veya x2.png bulunamazsa işlemi bitir
# 500 ms bekleme
time.sleep(0.5)
# x1.png için sürükleme ve sil.png tıklama işlemi
drag_and_drop_garbage(
image_path_x1)
# 500 ms bekleme
time.sleep(0.5)
# x2.png için sürükleme ve sil.png tıklama işlemi
drag_and_drop_garbage(
image_path_x2)
# 30 ms bekleme
time.sleep(0.03)
# clan2.png'nin üzerine git ve sol tıkla
coord_clan2, template_size_clan2 = find_image(
image_path_clan2)
if coord_clan2 is not None:
center_x_clan2 =
coord_clan2[
0] +
template_size_clan2[
0] // 2
center_y_clan2 =
coord_clan2[
1] +
template_size_clan2[
1] // 2
# Mouse'u clan2.png'nin ortasına getir
mouse_driver.move_and_click(
center_x_clan2,
center_y_clan2,
button='none')
print(
f"clan2.png bulundu, mouse ({center_x_clan2}, {center_y_clan2}) noktasına getirildi.")
# 20 ms bekle
time.sleep(
0.02)
# Sol tıklama işlemi
mouse_driver.move_and_click(
center_x_clan2,
center_y_clan2,
button='left')
print(
f"clan2.png üzerine sol tıklama yapıldı.")
else:
print(
"clan2.png bulunamadı, işlemlere devam ediliyor...")
# 50 ms bekleme
time.sleep(0.05)
# Verilen koordinatlara 5 ms arayla 2 kez sağ tıklama işlemi
def double_right_click(
x, y):
mouse_driver.move_and_click(
x, y,
button='right') # İlk sağ tıklama
print(
f"İlk sağ tıklama yapıldı: ({x}, {y})")
# 5 ms bekle
time.sleep(
0.005)
# İkinci sağ tıklama
mouse_driver.move_and_click(
x, y,
button='right')
print(
f"İkinci sağ tıklama yapıldı: ({x}, {y})")
# 1# 1579 210
double_right_click(
1579, 210)
# 20 ms bekleme
time.sleep(0.02)
# 2# 1628 215
double_right_click(
1628, 215)
# 20 ms bekleme
time.sleep(0.02)
# 3# 1683 215
double_right_click(
1683, 215)
# 20 ms bekleme
time.sleep(0.02)
# 4# 1739 215
double_right_click(
1739, 215)
# 20 ms bekleme
time.sleep(0.02)
# 5# 1789 215
double_right_click(
1789, 215)
# 20 ms bekleme
time.sleep(0.02)
# 6# 1580 267
double_right_click(
1580, 267)
# 20 ms bekleme
time.sleep(0.02)
# 7# 1579 267
double_right_click(
1849, 216)
# 20 ms bekleme
time.sleep(0.02)
# 8# 1630 267
double_right_click(
1630, 267)
# 20 ms bekleme
time.sleep(0.02)
# 9# 1683 267
double_right_click(
1683, 267)
# 20 ms bekleme
time.sleep(0.02)
# 10# 1732 267
double_right_click(
1732, 267)
# 20 ms bekleme
time.sleep(0.02)
# 11# 1790 267
double_right_click(
1790, 267)
# 20 ms bekleme
time.sleep(0.02)
# 12# 1841 267
double_right_click(
1841, 267)
# 20 ms bekleme
time.sleep(0.02)
# 13# 1577 321
double_right_click(
1577, 321)
# 20 ms bekleme
time.sleep(0.02)
# 14# 1633 321
double_right_click(
1633, 321)
# 20 ms bekleme
time.sleep(0.02)
# 15# 1684 321
double_right_click(
1684, 321)
# 20 ms bekleme
time.sleep(0.02)
# 16# 1737 321
double_right_click(
1737, 321)
# 20 ms bekleme
time.sleep(0.02)
# 17# 1788 321
double_right_click(
1788, 321)
# 20 ms bekleme
time.sleep(0.02)
# 18# 1840 321
double_right_click(
1840, 321)
# 20 ms bekleme
time.sleep(0.02)
# 19# 1579 341
double_right_click(
1579, 341)
# 20 ms bekleme
time.sleep(0.02)
# 20# 1629 341
double_right_click(
1629, 341)
# 20 ms bekleme
time.sleep(0.02)
# 21# 1681 341
double_right_click(
1681, 341)
break # Tüm işlemler tamamlandı
else:
print("referans.png bulunamadı, tekrar aranıyor...")
if keyboard.is_pressed('esc'):
print("Durduruldu.")
if __name__ == "__main__":
perform_actions()