#failing to start main?

17 messages · Page 1 of 1 (latest)

waxen bloom
#

hi, made this. basicly like an autologin for a gamelauncher. running restart.bat either if its successful or failed but after running it, it doesnt starts from first step of the main function

strong furnaceBOT
#

-# :warning: Files from unknown sources can be dangerous. Download with care. :warning:

waxen bloom
#

starts from this step instead,

            continue```
#

any idea why?

slate sun
#

That sounds very odd

waxen bloom
#

yeah...

#

if search_and_click("creator/tamam.png", confidence=0.8, timeout=30):

#

missing not can cause this?

slate sun
#

how

waxen bloom
#

idk really

#

yes, changing it to if not search_and_click fixed the issue. but now it cant write it to the txt

waxen bloom
#

oh well, it didnt fix it actually i was wrong

waxen bloom
#

still dont know why it didnt work

#

but added this;

    start_time = time.time()
    while time.time() - start_time < timeout:
        try:
            location = pyautogui.locateOnScreen(image_path, confidence=confidence)
            if location:
                pyautogui.click(location[0] + x_offset, location[1] + y_offset)
                return True
        except pyautogui.ImageNotFoundException:
            pass
        time.sleep(1)
    print(f"{image_path} bulunamadı. Arama süresi doldu.")
    os.system("restart.bat")
    time.sleep(5)
    main()
    return False```
#

so works now