Вот что имеем на данный момент. Отрабатывается открытие окна браузера с последующим запуском игры и зыкрытием стартовых диалоговых окон. Плюс реализован сбор ежедневных заданий.
#DEFINE WM_SYSCOMMAND: 0x0112
#DEFINE SC_CLOSE: 0xF060
#DEFINE PROFILE_NAME: "vk_user_data_"
#DEFINE GAME_TITLE: "Хроники Хаоса"
#DEFINE GAME_LINK: "https://vk.com/app5327745_569506422"
#DEFINE WINDOW_POS: 0, 0
#DEFINE WINDOW_SIZE: 1280, 840
#DEFINE GAME_CLIENT_POS: 200, 180
#DEFINE GAME_CLIENT_SIZE: WINDOW_SIZE
#INCLUDE "data\includes\mySub.cms"
FOR($counter, $counter < 10)
EXECUTE("palemoon.exe", STRCONCAT("-P ", PROFILE_NAME, $counter, " -new-window ", GAME_LINK))
$hwnd = #FALSE
WHILE($hwnd = #FALSE)
$hwnd = WNDFIND(GAME_TITLE)
END_CYC
WNDSETINFO($hwnd, WINDOW_POS, WINDOW_SIZE)
GAME_LOADING() // Ожидание загрузки игры
SKIP_OFFER() // Пропускаем рекламу
OPEN_DAILY_MISSIONS() // Открываем ежедневные миссии
COMPLETE() // Завершение миссиий
SENDMESSAGE($hwnd, WM_SYSCOMMAND, SC_CLOSE, 0)
WHILE(STRLEN(HGETTEXT($hwnd)))
WAITMS(25)
END_CYC
HALT
END_CYC
SUB(SKIP_OFFER)
$time = $_time_t + 5
WHILE($time > $_time_t)
GETSCREEN
COLORMODE(8)
IF_PICTURE_IN (GAME_CLIENT_POS, GAME_CLIENT_SIZE, "data\pictures\OFFER_CLOSE.bmp", -1, 100)
PRINT("offer_close found")
LCLICK($_return1 + 5 + RND(-2,2), $_return2 + 5 + RND(-2,2))
WAITMS(2500)
$time = $_time_t + 5
END_IF
END_CYC
END_SUB
SUB(OPEN_DAILY_MISSIONS)
STRSEPARATE("daily_missions.bmp;daily_missions_open.bmp", ";", $arr_temp)
$state = 0
WHILE($state < 2)
GETSCREEN (GAME_CLIENT_POS, GAME_CLIENT_SIZE)
COLORMODE (8, GAME_CLIENT_POS, GAME_CLIENT_SIZE)
IF_PICTURE_IN (GAME_CLIENT_POS, GAME_CLIENT_SIZE, STRCONCAT("data\pictures\", $arr_temp[$state]), -1, 100)
PRINT($arr_temp[$state], " found")
IF($state = 0)
LCLICK($_return1 + 40 + RND(-5,5), $_return2 + 20 + RND(-5,5))
WAITMS(1500)
END_IF
$state = $state + 1
ELSE
PRINT($arr_temp[$state], " not found")
END_IF
END_CYC
END_SUB
SUB(COMPLETE)
$check = #FALSE
WHILE($check = #FALSE)
GETSCREEN
COLORMODE(8)
IF_PICTURE_IN(GAME_CLIENT_POS, GAME_CLIENT_SIZE, "data\pictures\complete.bmp", -1, 100)
PRINT("complete found")
LCLICK($_return1 + 40 + RND(-5,5), $_return2 + 8 + RND(-5,5))
WAITMS(1500)
ELSE
PRINT("complete not found")
$check = #TRUE
END_IF
END_CYC
END_SUB
SUB(GAME_LOADING)
$game_loading = #FALSE
WHILE($game_loading = #FALSE)
GETSCREEN (GAME_CLIENT_POS, GAME_CLIENT_SIZE)
$game_loading = PXLCOUNT(GAME_CLIENT_POS, GAME_CLIENT_SIZE, 6225919)
WAITMS(25)
END_CYC
END_SUB