Okay that’s so weird. The original code :
import pyautogui
import time
# Максимальное значение для n
max_n = 50
# Функция для проверки цвета пикселя
def check_pixel_color(x, y, expected_color):
pixel_color = pyautogui.pixel(x, y)
return pixel_color == expected_color
field_x = 475
field_y = 805
expected_color = (56,22,22)
# Начальное значение n
n = 1
# Максимальное значение для n
max_n = 50
# Пока n меньше или равно максимальному значению
while n <= max_n:
# Проверяем цвет поля
if check_pixel_color(field_x, field_y, expected_color):
# Увеличить значение n
n += 1
# Перемещаем курсор в поле
pyautogui.click(471, 274)
pyautogui.click(471, 274)
# Очищаем поле
pyautogui.hotkey('ctrl','a')
pyautogui.press('delete')
# Вставить новое значение n
pyautogui.typewrite(str(n))
# Переходим к следующему полю (может потребоваться для срабатывания изменений)
pyautogui.click(634, 1050)
# Переходим к началу следующей итерации цикла
continue
# Если цвет поля не соответствует ожидаемому, выходим из цикла
break)
This is original code . It worked a week ago. I’ve (no making mistakes) changed the fields and places to click only. Today the python in cmd couldn’t start any command from pyautogui, so I updated Windows, Python, Pillow, pyautogui, pyscreeze and then I’ve tried to start a program. The cmd said nothing, just
D:\reshala>python reshala.py
D:\reshala>python reshala.py
D:\reshala>python reshala.py
Then I’ve added print “Hello world” after each step and realized that The steps up to while n <= max_n:
are played. So I deleted this stroke and cmd writes me about my mistakes
if check_pixel_color(field_x, field_y, expected_color): IndentationError: unexpected indent
continue
^^^^^^^^
SyntaxError: 'continue' not properly in loop
So now I’m trying to find correct places (number of Tabs) for continue and if
This is so fucking weird , I was should only change coordinates of clicking and the field
I think I should hire the sysadmin.
I can tell my story in more details in my discord @vladbulayev
- Yes, it is coloured with (56,22,22)
2)I know that looks illogical but without doubleclick the previous n won’t disappear and the pasted number will increase by the previous as 123456789101112131415161718192021 and so on.